![NXP Semiconductors MKL27Z128VFM4 Reference Manual Download Page 188](http://html1.mh-extra.com/html/nxp-semiconductors/mkl27z128vfm4/mkl27z128vfm4_reference-manual_1721847188.webp)
13.3.7.3 Framing Packet
The framing packet is used for flow control and error detection, and it (the framing
packet) wraps command and data packets as well.
The framing packet described in this section is used for serial peripherals including
LPUART, I2C and SPI. The USB HID peripheral does not use framing packets. Instead,
the packetization inherent in the USB protocol itself is used. Please refer to the
section for details.
Table 13-8. Framing Packet Format
Byte #
Value
Parameter
0
0x5A
start byte
1
packetType
2
length_low
Length is a 16-bit field that specifies the entire
command or data packet size in bytes.
3
length_high
4
crc16_low
This is a 16-bit field. The CRC16 value covers entire
framing packet, including the start byte and command
or data packets, but does not include the CRC bytes.
See the CRC16 algorithm after this table.
5
crc16_high
6 . . .n
Command or Data packet
payload
A special framing packet that contains only a start byte and a packet type is used for
synchronization between the host and target.
Table 13-9. Special Framing Packet Format
Byte #
Value
Parameter
0
0x5A
start byte
1
0xA
n
packetType
The Packet Type field specifies the type of the packet from one of the defined types
(below):
Table 13-10. packetType Field
packetType
Name
Description
0xA1
kFramingPacketType_Ack
The previous packet was received successfully; the sending
of more packets is allowed.
0xA2
kFramingPacketType_Nak
The previous packet was corrupted and must be re-sent.
0xA3
kFramingPacketType_AckAbort
Data phase is being aborted.
0xA4
kFramingPacketType_Command
The framing packet contains a command packet payload.
0xA5
kFramingPacketType_Data
The framing packet contains a data packet payload.
Table continues on the next page...
Functional Description
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
188
Freescale Semiconductor, Inc.