A.3
Low-level protocol
A low-level protocol has been defined to:
•
Split the data to be sent into packets (a small header is added to indicate the content of the packet)
•
Ensure their transmission
•
Possibly: check the validity of the data received and acknowledge it
This protocol allows user to send data of any size, both ways.
Each packet starts with a “Control Byte” or a “Status Byte”:
1.
A “Control Byte” is used to indicate the bytes present in the packet (packet data length, total, data length,
CRC presence and so on).
Figure 60.
Structure of a packet
MS54573V1
C
L
TL
DATA
CRC
Unused Bytes
Max mailbox size: 256 Byte
CTRL Byte
on 1 byte
Packet
Packet
data
length
on 1 byte (
optional
)
Total
length
on 4
byte (
optional
)
CRC
on 4 byte
(
optional
)
2.
A “Status Byte” is a single Byte sent in response to one or more received packets to indicate if the
transmission was successful or not.
Figure 61.
Structure of a status packet
MS54574V1
S
Unused Bytes
Status Byte
(1 byte)
The following table describes the content structure of the control byte.
Table 3.
Control byte structure definition
Bit number
Description
Bit 7
This bit must be set to 0 for a control byte (it is used to distinguish control bytes and status bytes).
Bit 6
Bit indicating if a packet data length field (on one byte) is present. It indicates the length of the data present in
this packet (including the CRC bytes, if any). If no packet data length field is present, the receiver considers that
the packet has the max possible size.
Bit 5
Segment End. When this bit is set, a CRC is present in this packet. The CRC is calculated on all the data
present between “Segment Start” and “Segment End”. An acknowledge must be sent by the receiver.
Bit 4
Segment Start
UM2949
Low-level protocol
UM2949
-
Rev 1
page 52/60