Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1251

Python • spidev with spi.max_speed_hz = 20000

$
0
0
Hello, I am developing software that runs on raspian on raspberry pi 3b and communicates with other devices using spi. For this I am using the spidev library in python. My problem is that one of the raspberry's spi limits my clock to 50khz, while the other I can lower it as much as I want, for example 20khz. I check all this by reading it on the oscilloscope, even though I put 20000 on the oscilloscope I have a 50khz signal. I understand that one of the raspberry's spi shares, in addition to spi, the uart and i2c (spi-bcm2835). Are there any limitations I should be aware of? From already thank you very much. How can i resolve this?.

Code:

spi = spidev.SpiDev()spi.open(0, 0)spi.max_speed_hz = 20000    spi2 = spidev.SpiDev()spi2.open(1, 2)spi2.max_speed_hz = 20000
Thanks in advance

Statistics: Posted by hans312 — Wed Apr 10, 2024 12:31 pm



Viewing all articles
Browse latest Browse all 1251

Trending Articles