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:
Where:
- n = #bytes in the response data field (1 to 8)
- tbit = baudrate-1
- ex. (19.2 kBit/s)-1 ~ 52.1 µS
LIN message fields are described in detail on this page.
Time Reserve
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 Serial Communications Interface (SCI) frame (Universal Asynchronous Receiver Transmitter (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:
LIN Schedule
Now that we understand the frame slot width of a LIN message, we can begin to understand the LIN schedule table.
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.
Time Base
LIN frame slots are scheduled based on a LIN cluster time unit, called the LIN time base, Tbase, which is usually 5 or 10 mS.
Tbase and tjitter are both defined in the "Nodes" section of the LDF as shown:
Example
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.
Table of Contents
|