Lopy SPI
-
Hi.
I am communicating through SPI an adc with integrated SPI with a lopy. My problem is that I receive the correct data most of the time but not all the time, so I used a logical analyzer to see the data frame sent by the lopy, and when I saw it I realized that sometimes the clock gets out of control. Is there any way to make sure that this doesn't happen?SPI config:
from machine import SPI
spi = SPI(0, mode=SPI.MASTER, baudrate=4000000, polarity=0, phase=1, firstbit=SPI.MSB)
rbuf = bytearray(4)
spi.write_readinto(bytes([0xD5, 0x8B, 0xD5, 0x8B]), rbuf)Images of the logic analyzer (three data frames):
The data frame above is the clock and the bottom one is the MOSI. As you can see in the third image, the clock isn't correct in the second and third byte.



Thank you and sorry about my english.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login