AP29000
Connecting C166 and C500 Microcontroller to CAN
Ways of handling the SAE 81C90/91 and the CAN Module on the C167CR / C515C
Application Note
45
V 1.0, 2004-02
Example: C167CR CPU clock:
20 MHz
⇒
t
CAN_CLOCK
=
100
ns
Desired CAN baudrate: 125 kBit/s
⇒
t
BIT
= 1 / baudrate = 8
µ
s
Using equation (7) results in the following table with the valid values of
(TSEG1 + TSEG2). Additionally, t
q
is calculated using equation (5).
Table 2
BRP
(0
≤
BRP
≤
63)
...
3 4 ...
7 ...
9 ...
TSEG1 + TSEG2
(1
≤
x
≤
22)
...
17 13 ...
7 ...
5
...
t
q
[ns]
... 400 500 ... 800 ... 1000 ...
When choosing one possibility for BRP, TSEG1, and TSEG2, some rules have to be
obeyed so that the CAN specification is fulfilled. Signal delays by the bus lines, input
comparators and output drivers have to be taken into account.
General rules for TSEG1 and TSEG2 depending on BRP:
Table 3
if BRP = 0:
if BRP
≥
1:
TSEG1
≥
2
TSEG1
≥
1
TSEG2
≥
1
TSEG2
≥
0
As a general rule, the sampling of the bit should take place at about 60-70% of the
total bit time. Nevertheless, for each system the delays of bus drivers, transmitter /
receiver circuits and the bus lines have to be taken into account when configuring the
sample point. Examples can be found in the "Description of the on-chip CAN Module",
page N-32 / N33.
If BRP is chosen to be 4, then TSEG1 + TSEG2 = 13 and t
q
is 500 ns. Therefore the
total bit time of 8 µs is devided into 16 t
q
. One t
q
is needed for the Synchronization
Segment which leaves 15 t
q
left for Phase Buffer Segment 1 and Phase Buffer
Segment 2 (see figure 17 again).
60% of 16 t
q
are about 10 t
q
which results in the following configuration:
•
1 t
q
for the Synchronization Segment
•
9 t
q
for Phase Buffer Segment 1
•
6 t
q
for Phase Buffer Segment 2.