English
Language : 

70353C Datasheet, PDF (61/76 Pages) Microchip Technology – Section 21. Enhanced Controller Area Network
Section 21. Enhanced Controller Area Network (ECAN™)
21
21.9.4.2 STEP 2: CALCULATE THE BAUD RATE PRESCALER
(BRP<5:0> (CiCFG1<5:0>))
Equation 21-3 shows the formula for computing the baud rate prescaler.
Equation 21-3: Baud Rate Prescaler
BRP<5:0> (CiCFG1<5:0>) = ------F----C----A---N------- – 1
(2 × FTQ)
21.9.4.3 STEP 3: SELECT THE INDIVIDUAL BIT TIME SEGMENTS
The Individual Bit Time Segments are selected using the CiCFG2 register:
Bit Time = Sync Segment + Propagation Segment + Phase Segment 1 + Phase Segment 2
Note 1: (Propagation Segment + Phase Segment 1) must be greater than or equal to the
length of Phase Segment 2.
2: Phase Segment 2 must be greater than the Synchronous Jump Width.
Example 21-8 shows the procedure to calculate the FTQ, to obtain a CAN Bus speed of 1 Mbps
when the dsPIC33E/PIC24E device is operating at 40 MHz.
Example 21-8: CAN Bit Timing Calculation Example
Step 1: Calculate the FTQ.
If FBAUD = 1 Mbps, and the number of time quanta ‘N’ = 20, then FTQ = 20 MHz
Step 2: Calculate the baud rate prescaler.
BRP<5:0> (CiCFG1<5:0>) = [40000000/(2 * FTQ)] - 1 = 1 - 1 = 0
Step 3: Select the individual bit time segments.
Synchronization Segment = 1 TQ (constant)
Based on system characteristics, if Propagation Delay = 5 TQ, if the sample point is to be at
70% of Nominal Bit Time, then:
Phase Segment 2 = 30% of Nominal Bit Time = 6 TQ
Phase Segment 1 = 20 TQ - (1 TQ + 5 TQ + 6 TQ) = 8 TQ
A code example for configuring the ECAN bit timing parameters is shown in Example 21-9.
© 2008-2011 Microchip Technology Inc.
DS70353C-page 21-61