以12M设备为例:
5k的波特率,则:
12000/5=2400 = (BRP+1)(1+TSEG1+1+TSEG2+1) = = 150*16
所以:BRP=149 TSEG1=12 TSEG1=1
CAN2BTR = 0X1C0095
6K的波特率:
12000/6=2000 = (BRP+1)(1+TSEG1+1+TSEG2+1) = = 125*16
所以:BRP=124 TSEG1=12 TSEG1=1
CAN2BTR = 0X1C007c
20K的波特率:
12000/20=600 = (BRP+1)(1+TSEG1+1+TSEG2+1) = = 30*20
所以:BRP=29 TSEG1=14 TSEG1=3
CAN2BTR = 0X3e001d
注意:(1+TSEG1+1)/ (1+TSEG1+1+TSEG2+1)为采样点,最好在80%时。