Chapter 21 LIN Controller (LINFlex)
MPC5602P Microcontroller Reference Manual, Rev. 4
524
Freescale Semiconductor
When the checksum reception is completed, an RX interrupt is generated to allow the software to read the
received data in the BDR registers.
One or several identifier filters can be configured for reception by programming IFCR
x
[DIR] = 0 and
activated by setting one or several bits in the IFER.
When at least one identifier filter is configured in reception and activated, and if the received identifier
matches the filter, an RX interrupt is generated after the checksum reception only.
Typically, the application has to copy the data from the BDR to SRAM locations. To copy the data to the
right location, the application has to identify the data by means of the identifier. To avoid this and to ease
the access to the SRAM locations, the LINFlex controller provides a Filter Match Index. This index value
is the number of the filter that matched the received identifier.
The software can use the index in the IFMI register to directly access the pointer that points to the right
data array in the SRAM area and copy this data from the BDR to the SRAM (see
Using a filter avoids the software reading the ID value in the BIDR, and configuring the direction, the data
field length and the checksum type in the BIDR.
If LINFlex cannot provide enough RX identifier filters to handle all identifiers the software has to receive
the data for, then a filter can be configured in mask mode (see
Section 21.8.2.3, Slave mode with identifier
) in order to manage several identifiers with one filter only.
21.8.2.2.3
Data discard
When LINFlex receives the identifier, the LINSR[HRF] bit is set and, if LINIER[HRIE] = 1, an RX
interrupt is generated. If the received identifier does not concern the node, you must program
LINCR2[DDRQ] = 1. LINFlex returns to idle state after bit DDRQ is set.
21.8.2.2.4
Error detection
In Slave mode, the following errors are detected:
•
Header error
: An error occurred during header reception (Break Delimiter error, Inconsistent
Synch Field, Header Timeout).
•
Bit error
: During transmission, the value read back from the bus differs from the transmitted value.
•
Framing error
: A dominant state has been sampled on the stop bit of the currently received
character (synch field, identifier field or data field).
•
Checksum error
: The computed checksum does not match the received one.
21.8.2.2.5
Error handling
In case of Bit Error detection during transmission, LINFlex stops the transmission of the frame after the
corrupted bit. LINFlex returns to idle state and an interrupt is generated if the BEIE bit in the LINIER is set.
During reception, a Framing Error leads LINFlex to discard the current frame. LINFlex returns
immediately to idle state. An interrupt is generated if LINIER[FEIE] = 1.
During reception, a Checksum Error leads LINFlex to discard the received frame. LINFlex returns to idle
state. An interrupt is generated if LINIER[CEIE] = 1.