© 2004 Microchip Technology Inc. DS70070B-page 23-61
Section 23. CAN
CAN Module
23
23.9.2 Prescaler Setting
There is a programmable prescaler, with integral values ranging from 1 to 64, in addition to a
fixed divide-by-2 for clock generation. The Time Quanta (T
Q) is a fixed unit of time derived from
the input clock frequency, F
CAN. Time quanta is defined as shown in Equation 23-1.
Equation 23-1: Time Quanta for Clock Generation
Example 23-1: Bit Rate Calculation Example
Example 23-2: Baud Rate Prescaler Calculation Example
The frequencies of the oscillators in the different nodes must be coordinated in order to provide
a system-wide specified time quantum. This means that all oscillators must have a T
OSC that is
a integral divisor of T
Q.
Note: FCAN must not exceed 30 MHz. If CANCKS = 0, then FCY must not exceed 7.5 MHz.
Where BRP is the binary value of BRP <5:0>
F
CAN is FCY or 4 FCY depending on CANCKS bit
T
Q =
2 (BRP<5:0> + 1)
F
CAN
If 4FCY = 32 MHz, BRP<5:0> = 0x01 and CANCKS = 0, then:
If Nominal Bit Time = 8 T
Q then:
Nominal Bit Rate Mbps
18125
9–
×10×()⁄=
T
Q = 2 • (BRP + 1) •
T
CY
= 2 X 2 X (1/32X10
6
) = 125ns
4
CAN Baud Rate = 125 kHz
F
CY = 5 MHz, CANCKS = 1
1. Select number of T
Q clocks per bit time (e.g., K=16).
3. Calculate BRP<5:0>:
BRP 2T
Q
T
CY
⁄()1–=
2500
9–
×10()
15
6
×10()⁄
-------------------------------=1–
4=
2. Calculate T
Q from baud rate:
T
Q
1 BaudRate()⁄
K
--------------------------------------=
1125
3
×10⁄
16
----------------------------500ns==
T
Q = 2 • (BRP + 1) • TCAN