FAQ 标题:如何在非标准频率下设置C2000 ECAN的波特率参数?
FAQ 正文:在非标准频率下设置C2000 ECAN的波特率参数的例子。
Calculation of the CAN bit timing :
System clock: f_sys = 24 MHz System clock period: t_sys=1/f_sys = 41.666667 ns BRP = 23 Desired bit rate is 125KBit/s, desired bit time is 8000 ns CAN time quantum: tq = 24 * t_sys = 1000ns Actual bit time = 8 * tq = ~= 8000 ns Actual bit rate is 124999.999bit/s ~= 125Kbit/s CAN bus length = 10 m, with 5 ns/m signal delay time. Propagation delay time : 2 * ( transceiver loop delay + bus line delay ) = 400 ns Prop_Seg = 1 * tq = 1000ns > 400ns. Sync_Seg = 1 tq . Phase_seg1 + Phase_Seg2 = (8-2) tq = 6 tq Phase_seg1 = 3 tq and Phase_Seg2 = 3 tq SJW = (min(Phase_Seg1, 4)) tq = 3 tq TSEG1 = (Prop_Seg + Phase_Seg1 - 1) = 3 TSEG2 = (Phase_Seg2 - 1) = 2 SJW_p = (SJW - 1) = 2
Clock tolerance df :
A: df < min(Phase_Seg1, Phase_Seg2) / (2 * (13*bit_time - Phase_Seg2)) B: df < SJW / (20 * bit_time) A: df < 3/(2*(13*11-3)) = 3/280 = 1.0714% B: df < 3/(20*11) = 3/220 = 1.3636%
|