A frame is constructed by two compositions: A header and a response.
The header is composed by the break field, a PID and the synch field.
The break filed is always generate by the master task and indicates the beginning of a new frame. The break field is composed by at least 13 nominal bits, all of these bits with a dominant value, followed by a break delimiter. The slave nodes will detect within a threshold of 11 dominant slave bits to determine that the header is about to be sent.
Synch byte field
A synch byte field has a data value of 0x55. This, along with the break field, indicates that the slave shall always be able to detect new frames headers and about old frame request to process the new frame.
Protected ID (PID)
The PID consists of a frame ID and a parity checker. The 2 most significant bits are parity checking whereas the others are used as the frame ID.
- The Frame ID is 6 bits long
- Values from 0x00 to 0x3B are intended to be used for frames carrying signals.
- Value of 0x3C or 0x3D are used to diagnostic and configuration carrying signals.
- Value of 0x3E and 0x3F are intended for future protocol enhancements.
- The parities bit are calculated based on the frame ID bits as follows:
- P0 = ID0 ⊕ ID1 ⊕ ID2 ⊕ ID4
- P1 !(ID1 ⊕ ID3 ⊕ ID5)
The data response carries between 1 to 8 bytes of data where the LSBs are sent first. In order to validation, the publisher and all subscribers shall agree about the data contained within a frame.
The response can contain two different types of checksums.
- Classic checksum, which is the inverted sum of data response, it is used for LIN 1.x nodes and diagnostic and configuration frames.
- Enhanced checksum, which is the inverted sum of data response plus PID,it is used for LIN 2.x nodes