PyBoard as SPI Slave -> parsing on the fly

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Harold
Posts: 1
Joined: Fri Mar 09, 2018 10:53 am

PyBoard as SPI Slave -> parsing on the fly

Post by Harold » Fri Mar 09, 2018 2:34 pm

Hello all,

I'd like to use my PyBoard as a SPI slave. I'd like the master to send commands to the PyBoard and this one answers.
My problem is that it looks like I need to know how long the command gonna be and I don't. :/
As some of the first bytes of the frame give me the information, I thought about fetching bytes individually. But looks like that when I do it, the end of the frame is lost.
I also thought about using the receive command with a timeout but problems occur if I receive more than one frame in it. For example, I got a buffer of 20 and I try to receive 2 frames of 15 bytes -> The last 10 bytes are lost.
So here are my questions:
-> Is it possible to receive bytes and parse them on the fly?
-> Is it possible to fully manage SPI on interrupt (I haven't found any interrupt triggered when some data are in the Rx buffer?)

Thanks in advance,

Harold

Post Reply