Specifications

4. Slave Design IP LIN Bus 2.0 Reference Design
40 Cypress Semiconductor – Rev. ** October 25, 2006
l_signal_handle: Name of the frame to which bytes have to
be written.
start: The offset from where the bytes have to be written.
count: Number of counts to be written.
data: Buffer from which the data have to be copied.
Example: For example, to write two bytes to Frame1 from
the first byte of the buffer from another buffer called Temp-
Buffer, use this code:
l_bytes_wr(Frame1, 0, 2, TempBuffer);
Note that the first byte of the frame buffer has an offset of
zero. That is why zero was used as the offset parameter.
Returns: None.
l_ifc_read_status
C Prototype: l_u16 l_ifc_read_status(void);
Description: The call returns a 16-bit status word.
Parameters: None.
Returns: 16-bit status word.
Usage Notes: This function is used by the foreground pro-
gram to monitor the LIN bus for error conditions. It is also
used by the main program to check if the slave has to be put
into power-down mode by checking the go to sleep bit. For
example, use this code to trap any errors in the LIN bus:
if((char)l_ifc_read_status() &
bfSTATUS_ERROR_IN_RESPONSE)
{
// Code to process error
}
l_ifc_irq_disable
C Prototype: void l_ifc_irq_disable(void);
Description: Disables system interrupts.
Parameters: None.
Returns: None.
l_ifc_irq_restore
C Prototype: void l_ifc_irq_restore(void);
Description: Restores system interrupts.
Parameters: None.
Returns: None.
l_ifc_wake_up
C Prototype: void l_ifc_wake_up(void);
Description: Generates a wakeup command on the bus.
This function sends a 0xF0 on the Lin bus, which will simu-
late a wakeup call.
Parameters: None.
Returns: None.
4.8 Time Study
4.8.1 ISR and Function Timing
The following tables list the time taken by some of the impor-
tant branches of ISRs in the LIN slave node IP. The CPU
overload for various conditions is roughly computed using
these tables.
Note that the times indicated are approximate and may
change during future revisions of the firmware
.
Table 4-3.
Bit
Number Description
Bit 0 Error in Response: This bit is set whenever there is an error
in the LIN transaction.
Bit 1 Successful Transfer: This bit is set when the last frame was
successfully processed.
Bit 2 Overrun: This bit is set when the last status was not read
before the next update.
Bit 3 Go To Sleep: This bit is set when a go to sleep command
has been received. This bit is also set by the firmware when
a bus idle is detected.
Bits 4 to7
Bits 8 to 15 Last Frame Protected ID: This byte has the protected ID of
the frame that was processed last.
Table 4-4. GPIO Interrupt
Sl. No. Stage No. Of Cycles
Time(µS)
1 Dominant Break 264 11.00
2 Recessive Break 325 13.54
3 Synchro Field Start 224 9.33
4 Falling Edge 1 351 14.63
5 Falling Edge 2 296 12.33
6 Falling Edge 3 296 12.33
7 Falling Edge 4 3618 150.75
8 Total Time for Break/Synch 223.92
Table 4-5. Rx Interrupt
Sl. No. Stage No. Of Cycles
Time(µS)
1 Known ID received, TX initialized 940 39.17
2 Unknown ID received 1103 45.96
3 Known ID received, RX initialized 390 16.25
4 Frame reception complete 1747 72.79
5 One data byte received 159 6.63