AN12728
How to Use CAN-FD to Transfer Data on LPC5500 Series
Rev. 3 - 17 June, 2021
1 Introduction
The LPC55S1x/LPC55S0x features a CAN controller supporting CAN-FD.
LPC5500 series SDK provides the
demonstrates the use of CAN to transfer data. Based on this example,
this application note describes how to use CAN-FD's Bit Rate Switch and
transmitter delay compensation features. Enabling these two features can
improve throughput and eliminate the bit error caused by transmitter delay.
2 CAN-FD
CAN-FD is defined in the international standard ISO 11898-1:2015. For quick
start on using CAN-FD, this section introduces some key features of CAN-FD
and aims the users who are familiar with CAN.
2.1 Differences between CAN and CAN-FD
There are two key differences between classical CAN and CAN-FD. The first is that CAN-FD can use much higher bitrates than
classical CAN. Classical CAN is limited to 1 Mbit/s. CAN-FD does not have a theoretical limit, but in practice it is limited by the
transceivers. The second key difference is the increased amount of data per CAN message. Classical CAN is limited to 8 bytes.
CAN-FD limit is increased eight-fold to 64 bytes per message.
With the increased amount of data per CAN message, CAN-FD frames need higher bit rate to decrease the delay time in the
communication and increase real-time performance. The CAN-FD frames can reach higher bit rates through enabling bitrate
switch feature.
On the other hand, the bit rate is higher, the bit time is shorter. In order to enable a data phase bit time that is even shorter than the
transmitter delay, the delay compensation is introduced. Without transmitter delay compensation, the bit rate in the data phase
of a CAN-FD frame is limited by the transmitter delay.
2.2 Bit Rate Switch
In the CAN-FD frame control phase, data phase, and CRC phase are transmitted with a higher bit rate than the beginning and the
end of the frame.
The Bit Rate Switch feature is enabled by setting the BRSE bit in the CCCR register. When enabling the Bit Rate Switch, we also
need to set arbitration phase bit rate (before enabling Bit Rate Switch) and data phase bit rate (after enabling Bit Rate Switch)
correctly. The arbitration phase bit rate is set by the NBTP register, the data phase bit rate is set by DBTP register.
2.3 Transmitter delay compensation
The protocol unit of the MCAN has implemented a delay compensation mechanism to compensate the transmitter delay. The
transmitter delay compensation enables configurations where the data bit time is shorter than the transmitter delay, that is
described in detail in the new ISO11898-1. It is enabled by setting the TDC bit in the DBTP register. The TDCO field in the TDCR
register is used for setting the transmitter delay compensation offset. The offset value defines the distance between the measured
delay from m_can_tx to m_can_rx and the secondary sample point. The transmitter delay compensation offset and secondary
sample point are show in
Figure
mcan_interrupt_transfer
1.
Contents
1
2
2.1
example
2.2
2.3
3
3.1
3.2
3.3
3.4
3.5
4
Application Note
CAN-FD...........................................1
CAN-FD....................................... 1
..................................................... 1
Need help?
Do you have a question about the LPC5500 Series and is the answer not in the manual?
Questions and answers