
294
Chapter 16
CAN Controller
User’s Manual U16504EE1V1UD00
Limits on defining the bit timing
The sample point position needs to be programmed between 3TQ
and 17TQ, which equals a
register value of
2
≤
SPTxn
≤
16
(n = 0, 1; x = 4 to 0).
The number of TQ per bit is restricted to the range from 8TQ to 25TQ, which equals a register
value of
7
≤
DBTxn
≤
24
(n = 0, 1; x = 4 to 0).
The length of phase segment 2 (TSEG2) in TQ is given by the difference of TQ per bit (DBTxn)
and the sample point position (SPTxn). Converted to register values the following condition
applies:
2
≤
DBTxn - SPTxn
≤
8
(n = 0, 1; x = 4 to 0).
The number of TQ allocated for soft synchronization must not exceed the number of TQ for phase
segment 2, but SJWyn may have as many TQ as phase segment 2:
SJWyn
≤
DBTxn - SPTxn - 1
(n = 0, 1; x = 4 to 0; y = 0, 1).
Note:
Sample point positions of 3 TQ or 4 TQ are for test purposes only. For the minimum number of
TQ per bit time, 8TQ, the minimum sample point position is 5 TQ.
Example
:
At first, calculate the overall prescaler value:
16 can be split as 1 x 16 or 2 x 8. Other factors can not be mapped to the registers. Only 8 and 16
are valid values for TQ per bit. Therefore the overall prescaler value realized by BRPRSn is 2 or 1
respectively.
With TLMODE = 0 the following register settings apply:
System clock:
fx
8 MHz
CAN parameter:
Baud rate
500 kBaud
Sample Point
75%
SJW
25%
Register value
Description
Bit fields
BRPRSn = 00h
Clock selector = fx
PRMn = 00b
BRPRSx = 000000b
SYNC0n = A7h
CAN Bit in TQ = 8
DBTx = 00111b
7 < (fx/Baudrate/bit rate prescaler) < 25]
SYNC1n = 0zzz0100b sample point 75% = 6 TQ
SPTx = 00101b
SJW 25% = 2 TQ
SJWy = 01b
1 TQ equals 2 clocks & BRPRS6, 7 are disabled
TLMODE = 0
z depends on the setting of:
- Number of sampling points
- Receive only function
- Use of time stamp or global time system
Baudrate
------------------------
MHz
500
KBaud
------8
16
=
=