dsPIC30F Family Reference Manual
DS70070B-page 23-60 © 2004 Microchip Technology Inc.
23.9 CAN Baud Rate
All nodes on any particular CAN bus must have the same nominal bit rate. The CAN bus uses
NRZ coding which does not encode a clock. Therefore the receivers independent clock must be
recovered by the receiving nodes and synchronized to the transmitters clock.
In order to set the baud rate the following bits have to be initialized:
• Synchronization Jump Width (see Section Section 23.9.6.2 “Re-synchronization”)
• Baud Rate Prescaler (see Section Section 23.9.2 “Prescaler Setting”)
• Phase Segments (see Section Section 23.9.4 “Phase Segments”)
• Length Determination of Phase Segment 2 (see Section Section 23.9.4 “Phase
Segments”)
• Sample Point (see Section Section 23.9.5 “Sample Point”)
• Propagation Segment Bits (see Section Section 23.9.3 “Propagation Segment”)
23.9.1 Bit Timing
As oscillators and transmission time may vary from node to node, the receiver must have some
type of PLL synchronized to data transmission edges to synchronize and maintain the receiver
clock. Since the data is NRZ coded, it is necessary to include bit-stuffing to ensure that an edge
occurs at least every 6 bit times, to maintain the Digital Phase Lock Loop (DPLL) synchronization.
Bus timing functions executed within the bit time frame, such as synchronization to the local
oscillator, network transmission delay compensation, and sample point positioning, are defined
by the programmable bit timing logic of the DPLL.
All controllers on the CAN bus must have the same baud rate and bit length. However, different
controllers are not required to have the same master oscillator clock. At different clock
frequencies of the individual controllers, the baud rate has to be adjusted by adjusting the
number of time quanta in each segment.
The nominal bit time can be thought of as being divided into separate non-overlapping time
segments. These segments are shown in Figure 23-20.
• Synchronization segment (Sync Seg)
• Propagation time segment (Prop Seg)
• Phase buffer segment 1 (Phase1 Seg)
• Phase buffer segment 2 (Phase2 Seg)
The time segments and also the nominal bit time are made up of integer units of time called time
quanta or T
Q. By definition, the nominal bit time has a minimum of 8 TQ and a maximum of 25 TQ.
Also, by definition the minimum nominal bit time is 1 µsec, corresponding to a maximum 1 MHz
bit rate.
Figure 23-20: CAN Bit Timing
Input Signal
Sync
Prop
Segment
Phase
Segment 1
Phase
Segment 2
Sync
Sample Point
TQ