A key property of the Local Interconnect Network (LIN) protocol is the use of schedule tables. Schedule tables make it possible to assure that the bus will never be overloaded. They are also the key component to guarantee the periodicity of signals.
The Schedule Table in the LIN Description File (LDF) defines the sequence and time grid in which messages are sent. Once the table has been worked through, the Master begins with the first message again.
In order to develop the schedule table, you need to be able to calculate the duration of LIN messages (i.e. the Frame Slot Width).
Nominal Message Length
The following demonstrates the basic minimum frame slot duration, tFrame_Nom:
- n = #bytes in the response data field (1 to 8)
- tbit = Baudrate-1
- ex. (19.2kBit/s)-1 ~ 52.1 µS
LIN Slaves are typically implemented using low-cost, lower speed microcontrollers. Thus, the specification allows a time reserve of up to 40% to be added to each SCI frame (UART byte) as shown:
Frame Slot Width
Finally, a small delay tolerance is specified for the Master Node, called tJitter in order to create the final Frame Slot Width:
Now that we understand what the Frame Slot Width of a LIN message is, we can begin to understand what a LIN Schedule Table could look like.
The following depicts an example LIN schedule, and corresponding LIN frame slots:
The length of each frame slot varies and depends upon the number of expected data bytes in the response message.
LIN Frame Slots are scheduled based on a LIN cluster time unit, called the LIN Time Base, Tbase, which is usually 5 or 10mS.
Tbase and tjitter are both defined in the "Nodes" section of the LIN Description File (LDF) as shown:
The following example depicts a LIN schedule table within an LDF. The table has a "Main" sub-table defining four frame slots. The time base is 5 mS (not shown). The delay parameter specifies the frame slot duration in mS. The value must be a multiple of the Time Base.