LPC2368 can波特率學(xué)習(xí)
以12M設(shè)備為例:
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%時。
評論