Functional Description
799
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Controller Area Network (CAN) Module
Table 11-3. CANBIT Register Values
CANBIT Register Field
Setting
TSEG2
Phase2 – 1
TSEG1
Prop + Phase1 – 1
SJW
SJW – 1
BRP
BRP
Therefore, the length of the bit time is (programmed values):
[ TSEG1 + TSEG2 + 3] t
q
or (functional values):
[Sync + Prop + Phase2] t
q
The data in the CANBIT register is the configuration input of the CAN protocol controller. The baud rate
prescaler (configured by the BRP field) defines the length of the time quantum, the basic time unit of the
bit time; the bit timing logic (configured by TSEG1, TSEG2, and SJW) defines the number of time quanta
in the bit time.
The processing of the bit time, the calculation of the position of the sample point, and occasional
synchronizations are controlled by the CAN controller and are evaluated once per time quantum.
The CAN controller translates messages to and from frames. In addition, the controller generates and
discards the enclosing fixed format bits, inserts and extracts stuff bits, calculates and checks the CRC
code, performs the error management, and decides which type of synchronization is to be used. The bit
value is received or transmitted at the sample point. The information processing time (IPT) is the time after
the sample point needed to calculate the next bit to be transmitted on the CAN bus. The IPT includes any
of the following: retrieving the next data bit, handling a CRC bit, determining if bit stuffing is required,
generating an error flag or simply going idle.
The IPT is application-specific but may not be longer than 2 t
q
; the IPT of the CAN is 0 t
q
. Its length is the
lower limit of the programmed length of Phase2. In case of synchronization, Phase2 may be shortened to
a value less than IPT, which does not affect bus timing.
11.3.16 Calculating the Bit Timing Parameters
Usually, the calculation of the bit timing configuration starts with a required bit rate or bit time. The
resulting bit time (1/bit rate) must be an integer multiple of the system clock period.
The bit time may consist of 4 to 25 time quanta. Several combinations may lead to the required bit time,
allowing iterations of the following steps.
The first part of the bit time to be defined is Prop. Its length depends on the delay times measured in the
system. A maximum bus length as well as a maximum node delay has to be defined for expandable CAN
bus systems. The resulting time for Prop is converted into time quanta (rounded up to the nearest integer
multiple of t
q
).
Sync is 1 t
q
long (fixed), which leaves (bit time – Prop – 1) t
q
for the two Phase Buffer Segments. If the
number of remaining t
q
is even, the Phase Buffer Segments have the same length, that is, Phase2 =
Phase1, else Phase2 = 1.
The minimum nominal length of Phase2 has to be regarded as well. Phase2 may not be shorter than the
CAN controller's Information Processing Time, which is, depending on the actual implementation, in the
range of [0 to 2] t
q
.
The length of the synchronization jump width is set to the least of 4, Phase1, or Phase2.
The oscillator tolerance range necessary for the resulting configuration is calculated by the formula given
in
: