Hi All,
I'm using pyboard connected to SPI lines. Those lines have messages that each message is 128Bytes.
when I'm using spi.recv(128) I'm getting a mess of messages ( some from the middle of a message some from the end of the message).
The SPI CLK is: 10Mhz
SPI space between messages is: 0.2mS
other properties:
pyb.freq() --> (168000000, 168000000, 42000000, 84000000)
SPI(2, mode=2, baudrate=25000000, polarity=0,phase=1,bits=8,firstbit=SPI.LSB)
Does someone have an idea how to capture the message as a complete message (when CS enables) and save it?
Thanks
pyboard - SPI capture issue
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pyboard - SPI capture issue
I take it you're using peripheral (slave) mode, although mode=2 is not a value I'm familiar with. The Pyboard D I have here reports 0 and 260 for the two available values.
The problem is likely to be that your processing of the data takes longer than 200μs, causing the next read to be miss-framed. Bear in mind that .read() is a blocking call.
[EDIT]
I deleted your other post which is effectively a duplicate of this one.
The problem is likely to be that your processing of the data takes longer than 200μs, causing the next read to be miss-framed. Bear in mind that .read() is a blocking call.
[EDIT]
I deleted your other post which is effectively a duplicate of this one.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: pyboard - SPI capture issue
Thank you Peter for your help.
As you can see from the attached snapshot from Saleae that the frame(width of the message) is 98.4uS
Do you think that the pyboard can handle this kind of stream?
Do you think that other python modules can handle this kind of load?
As you can see from the attached snapshot from Saleae that the frame(width of the message) is 98.4uS
Do you think that the pyboard can handle this kind of stream?
Do you think that other python modules can handle this kind of load?
- Attachments
-
- Screenshot 2022-06-01 210131.png (6.88 KiB) Viewed 22082 times
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pyboard - SPI capture issue
It's as I said above. You're getting 128*8=1024 bits at 10MHz so your frame period is indeed 98μs. It's the 200μs gap between these frames which may be the limiting factor, depending on what you do with those 128 bytes after you've received them.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.