Sink0
Full Member level 6
- Joined
- Nov 25, 2009
- Messages
- 390
- Helped
- 37
- Reputation
- 74
- Reaction score
- 30
- Trophy points
- 1,308
- Location
- Sao Paulo, Brazil
- Activity points
- 4,186
Hi, i am implementing a half-duplex bus connection, and all the CRC, check, framing, ack and nack are handled by FPGAs. I need to reduce the messages at most, but keeping it safe and with a predictable behavior.
There are several slaves and one master. For now just messages between slave and master will be implemented. The master keeps polling every slave on the network, and when a slave have a pack it send the pack after the poll, and if does not have any pack, it sends an ack. If the slave sent an message the master should ack the message. If there is no response from the slave after a certain time the master will poll again. If the slave do not answer again the master will report an error and jump the slave and report an error.
All the messages have an 1byte address, 1 byte id, 1 byte command, 1 byte size, max of 255 bytes of data and 2 bytes crc.
If a slave send a pack to the master and the crc is wrong, the master send an nack, and the slave should resend the message.
If the master receives 2 identical consecutive messages (id, cmd, sz and crc) from the same slave, the message is discarted.
I have a few questions and need sugestions about this system.
First, should an ack message have crc bytes too? If yes and the ack crc is wrong, should the slave/master send an nack?
Is 16 bytes crc secure for this size of message?
Any sugestions to keep this communication as much predictable as possible without adding much overhead?
For reliability and eficinecy reasons both controlles (master and slave) will always be implemented on purely hardware.
Thank you!
There are several slaves and one master. For now just messages between slave and master will be implemented. The master keeps polling every slave on the network, and when a slave have a pack it send the pack after the poll, and if does not have any pack, it sends an ack. If the slave sent an message the master should ack the message. If there is no response from the slave after a certain time the master will poll again. If the slave do not answer again the master will report an error and jump the slave and report an error.
All the messages have an 1byte address, 1 byte id, 1 byte command, 1 byte size, max of 255 bytes of data and 2 bytes crc.
If a slave send a pack to the master and the crc is wrong, the master send an nack, and the slave should resend the message.
If the master receives 2 identical consecutive messages (id, cmd, sz and crc) from the same slave, the message is discarted.
I have a few questions and need sugestions about this system.
First, should an ack message have crc bytes too? If yes and the ack crc is wrong, should the slave/master send an nack?
Is 16 bytes crc secure for this size of message?
Any sugestions to keep this communication as much predictable as possible without adding much overhead?
For reliability and eficinecy reasons both controlles (master and slave) will always be implemented on purely hardware.
Thank you!