Borisw37
Newbie level 4
- Joined
- Dec 16, 2013
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 65
I have a master device that spits out 256 byte SPI messages (with some delay in between messages). The SS pin is pulled low at start of transmission and goes high at the end.
The slave needs to acquire the entire message but also be able to discard a message if let's the slave processor was busy and missed some data.
The SPI peripheral is setup with an interrupt but how do I go about telling if its start of the frame or not..? The values in the data can be 0-255 so I can't really have a "START" or "END" byte set to a particular value.
Do I setup a time out, if full message not received in X time, discard message?
Do I need to add an additional pin that let's say will stay high only during the 1st byte of the data?
Any thoughts on this topic will be useful.
I'm using PIC32 as a slave.
The slave needs to acquire the entire message but also be able to discard a message if let's the slave processor was busy and missed some data.
The SPI peripheral is setup with an interrupt but how do I go about telling if its start of the frame or not..? The values in the data can be 0-255 so I can't really have a "START" or "END" byte set to a particular value.
Do I setup a time out, if full message not received in X time, discard message?
Do I need to add an additional pin that let's say will stay high only during the 1st byte of the data?
Any thoughts on this topic will be useful.
I'm using PIC32 as a slave.