I'm using python and spidev to do spi transactions over the Raspberry Pi's spi channel. I'm having a couple of different things happen that are not what I am expecting.


This is a capture of a spi transaction. Channel 1 is the SCLK Channel 2 is the SDI and Channel 4 is the CSB. It's worth noting that for my application I need 4 CSB lines. Due to this I am manually driving the 4 GPIO pins using another library and just leaving the dedicated spi lines unconnected. There are a few things here that are going wrong.

First of all the jitter, around the center of the oscilloscope you can see weird jitter in all three signals. I am unsure as to what is causing this but would like to eliminate it as I believe it may be causing issues.

Secondly the clock frequency, in my code I am setting the frequency to 100kHz yet the recorded frequency is 40kHz this seems to be a known issue with SPI on the Rpi but I haven't found any ways to ensure that I can get my desired frequency.

Any insights into what could be happening here would be very appreciated I am not sure what things I should be looking into to find the solution to this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.