STMicroelectronics SPC572L series Reference Manual page 1419

Table of Contents

Advertisement

RM0400
To receive data from a slave node, the master sends a header with the corresponding
Identifier. The data received from the slave is stored in the message buffer and the status of
the message is stored in the LINSR.
If the response has been received successfully, the LINSR (DRF) bit is set. In case of error,
the DRF flag is not set and the corresponding error flag is set in the LINESR (refer to error
handling). It is possible to handle frames with a Response size larger than eight bytes of
data (extended frames). If the data field length in the BIDR is configured with a value higher
than eight data bytes, the LINSR (DBFF) bit is set once the first eight bytes have been
received. The application has to read the buffer BDR before resetting the DBFF bit. Once
the last data byte (or the checksum byte) has been received, the DRF flag is set.
Data Discard
If the user wants to discard the data after header transmission, then the DDRQ bit in
LINCR2 should be set.
50.3.2.4
Slave mode
This mode is selected when the MME bit of the LINCR1 register is cleared.
Data transmission
On header reception, the HRF bit is set and an RX interrupt is generated. The software must
then:
1.
read the received ID in the BIDR register
2.
fill the BDR[0:x] register
3.
program the CCS and DIR bits in the BIDR register
4.
specify the data field length DFL[5:0] bits in the BIDR register
5.
trigger the data transmission by setting the DTRQ bit
Note that the HRF bit should be reset only after the DTRQ bit is set. For the DTRQ to be
effective, the HRF bit must be set. This is to ensure that DTRQ is not set randomly, but only
after a header reception. It must be noted that you cannot set the DIR and DTRQ bits once
RXbusy is asserted in LINSR.
Alternately, one or more Identifier filters are configured for transmission by setting the DIR
bit and activated by setting the enable bits in IFER. When at least one Identifier filter is
active and configured for transmission and the received ID matches the filter, a TX interrupt
is generated. The software can use the index in the IFMI register to point directly to the
corresponding data array in the RAM and copy this data to the BDR[0:7]. The use of a filter
saves software the processing time required to read the ID value in the BIDR, match it, and
configure the data field length and checksum type.
If the number of filters provided by LINFlexD are not sufficient for the application, mask
mode can be used for the filters.
The transmitted data is also received by the same node and copied to the buffer.
Data reception
When LINFlexD is the subscriber of the data of the received identifier, then on header
reception the HRF flag is set and an RX interrupt is generated. The software must read the
received ID from the BIDR register and specify the data field length before the reception of
the stop bit of the first data byte. When the checksum is received, an RX interrupt is
generated for software to read the received data from BDR[0:7] and the RMB bit is set.
Software must then release the data buffer by resetting the RMB bit in the LINSR.
DocID027809 Rev 4
LINFlexD
1419/2058
1506

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SPC572L series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents