Specifications

October 25, 2006 Cypress Semiconductor – Rev. ** 29
LIN Bus 2.0 Reference Design 3. Master Design IP
The overall CPU overhead for a frame is calculated by add-
ing all the time components for a frame and then finding the
fraction of the total frame time. Remember, this method only
gives the overhead over a complete frame. The overhead at
different instances of the frame may be different.
3.8.2 Calculation of CPU Overhead Over
a Frame
The following calculations are based on a baud rate of 19.2
kbps and CPU speed of 24 MHz. For lower baud rates, the
CPU overhead is less.
Example 1: A frame of 1 byte being transmitted.
Total time for break/synch: This is the sum of the time taken
in the synchro break ISR and inside the bit time counter ISR.
Time taken in synchro break ISR = 36 µS.
Time taken inside the bit time counter ISR = 14 * 2.63 µS =
36.82 µS.
Transmission: 3 bytes sent are synch byte, data byte and
checksum. Total time is time taken by the TX ISR and the
TX bit time counter ISR.
Time taken by TX ISR = 3 * 2.42 µS = 7.26 µS.
Time taken by bit time ISR = 30 * 2.7 µS = 81 µS.
Time taken in bit time ISR at frame complete = 41.21 µS.
Total time taken by ISRs = 202 µS.
Total bits in frame = 54.
Total frame time = 1.4 * 54 * 1/19.2K = 3.93 mS.
Overall CPU overhead = 202 µS / 3.93 mS = 5.14%.
For calculation purposes, the worst case frame length of 1
byte was used. For an 8-byte frame, the overhead is
reduced to 4.5%.
Example 2: A frame of 1 byte being received.
Total time for break/synch: This is the sum of the time taken
in the synchro break ISR and inside the bit time counter ISR.
Time taken in synchro break ISR = 36 µS.
Time taken inside the bit time counter ISR = 14 * 2.63 µS =
36.82 µS.
Transmission: 1 synch byte, data byte and checksum. Total
time is time taken by the TX ISR and the TX bit time counter
ISR.
Time taken by TX ISR = 1 * 2.42 µS = 2.42 µS.
Time taken by bit time ISR = 10 * 2.7 µS = 27 µS.
Reception: 1 data byte.
Time taken by RX ISR = 1 * 3.96 µS = 3.96 µS.
Time taken by RX bit time counter ISR = 4 * 1.13 µS = 4.52.
Frame reception complete during checksum byte = 69.96
µS. (The RX ISR time during checksum byte is different.)
Total time = 180.68 µS.
Total bits in frame = 54.
Total frame time = 1.4 * 54 * 1/19.2K = 3.93 mS.
Overall CPU Overhead = 180.68 µS / 3.93 mS = 4.59%.
For calculation purposes, the worst case frame length of 1
byte was used. For an 8-byte frame, the overhead will come
down to 2.5%.
3.8.3 Maximum Interrupt Latency
This is the maximum latency the LIN node can cause in an
application. Using the above table, the maximum time taken
inside the ISR is in the RX ISR when a slave response was
received and this value is 74 µS. Take this value into consid-
eration when the interrupts of the main application are
designed/analyzed.