Message Encoding
Spaced Message:
P+ID
P+ID
P
Header
Header
Length
Length
Data…
Data…
Checksum
Checksum
EOM
ID Repeat:
P
ID
ID
ID
ID
ID
EOM
Figure 1. Message Formats
In both cases, the data manager hardware on Echo is employed to process received signals and detect the
ID and header portions. The length, data, and checksum fields only are returned to the MCU on the SPI.
Table 1 provides a description of each field of a message.
Table 1. Message Format Field Description
Field
Preamble
Description
This sequence is required before the ID and header fields and allows Echo to synchronize with the clock
encoded in the received signal and prepare for receiving the message.
ID
Determines which device or devices should receive the message. Only messages whose ID field matches the
device ID stored in Echo’s ID register are successfully received and sent to the MCU. Messages may be sent
with any ID.
Header
The header signals the beginning of the data in a message. After the header has been recognized, Echo
returns all following bytes to the MCU on the SPI lines until it encounters the end of message (EOM)
sequence. The header is chosen via a #define in Echo.h.
Note: There are some restrictions on the ID and header combinations that can be used. The header must not
be contained within the ID or, if using ID repeat mode, it must not be contained in a sequence of IDs.
Note: A further consideration is that the preamble must contain either one or four 0 bits, which form a prefix
on the ID. The header must not be found within the prefixed ID. Device IDs must be unique even when
prefixed with one or more 0 bits.
Length
Data
This specifies the number of bytes in the immediately following data field. This may be a value up to 127.
Contains the actual message sent: up to 127 data bytes.
Checksum
The checksum is the sum of the ID, length, and data fields (mod 256). This is generated automatically by the
driver on transmission and checked on reception to provide a basic error detection facility.
EOM
Indicates the end of the current message.
4
Message Encoding
The application sets up transmit message buffers with the parameters and data required for the
transmission. The driver reads and encodes the information before it is sent to Echo for transmission.
Software Drivers for MC33696, Rev. 1
Freescale Semiconductor
3