SPI, spidev: scope shows activity on CS line but no data

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
m_kramar
Posts: 4
Joined: Sun Apr 01, 2018 4:35 pm

SPI, spidev: scope shows activity on CS line but no data

Post by m_kramar »

I'm using RaspberryPI Zero W.
I'm trying to use spidev to control SPI with python.
I enabled SPI in config.txt, I installed spidev, I gave it permissions.
I believe SPI is properly enabled because

Code: Select all

root@DietPi:/dev# lsmod | grep spi
spidev                  7220  118
spi_bcm2835             7456  0
and

Code: Select all

root@DietPi:/dev# ls -la /dev/spi*
crw-rw---- 1 root spi 153, 0 Apr  1 13:17 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Apr  1 13:17 /dev/spidev0.1
When I try to run sample spidev script it does not report any problems.
Using scope I can only see CS line going down and then back up, MISO, MOSI and CSK lines show no activity.

Any ideas what am I missing?
m_kramar
Posts: 4
Joined: Sun Apr 01, 2018 4:35 pm

Re: SPI, spidev: scope shows activity on CS line but no data

Post by m_kramar »

OK I found the problem.
I had to set SPI speed:

Code: Select all

 spi.max_speed_hz = 500000
Now I see both clock and data.
I suspect it was running on too high frequency (same a score?)
Post Reply