Command/Response Format

All UART commands must conform to this general format:

UART Master Commands:
Byte Number Description Comments
0 Start of Frame Always equal to 0xC5
1 Command Byte Specifies which master command is contained in this message.
2 Command Version An 8-bit number used to indicate the version number of the command.
3 Message Number An 8-bit number incremented by the master device.
Expected to rollover: 253, 254, 255, 0, 1, 2, ...
4 Payload Length (MSB) Most significant byte of the payload length.
Note that the maximum payload length is 256 bytes. 
5 Payload Length (LSB) Least significant byte of the payload length. 

Payload Byte 0

Payload Byte 1

Payload Byte 2
... ...
Payload Length + 6 Checksum Byte (MSB) The MSB of a 16-bit CRC. See the "Checksum" section for details. 
Payload Length + 7 Checksum Byte (LSB) The LSB of a 16-bit CRC.
UART  Slave Responses:
Byte Number Description Comments
0 Start of Frame Always equal to 0xC5
1 Command Byte Specifies which master command is being replied to. 
2 Message Number Specifies the message number that is being replied to.
3 ACK Byte See "Acknowledgement Byte" section.
4 Payload Length (MSB) MSBof the total number of bytes in the payload.
5 Payload Length (LSB)
LSBof the total number of bytes in the payload.

Payload Byte 0

Payload Byte 1


Payload Byte 2

... ...
Payload Length + 6 Checksum Byte (MSB) TheMSB of a 16-bit CRC. See the “Checksum” section for details.
Payload Length + 7 Checksum Byte (LSB)
The LSB of a 16-bit CRC.

0 Comments

Add your comment

E-Mail me when someone replies to this comment