2009-05-17 06:50 AM
CAN Bit timing Calculation
2011-05-17 04:08 AM
(RM p510)
CAN BaudRate = 1 / NominalBitTime - NominalBitTim = 1*tq + tBS1 + tBS2 - tBS1 = tq * (TS1 + 1), tBS2 = tq * (TS2 + 1) - tq = (BRP + 1) * tPCLK - then... - NominalBitTim = 1*tq + tBS1 + tBS2 = 1*tq + tq * (TS1 + 1) + tq * (TS2 + 1) = tq(1 + (TS1 + 1) + (TS2 + 1)) = tq(3 + TS1 + TS2) - if BaudRate = 20K... 20K = 1 / (tq(3 + TS1 + TS2) - TS1= 1, TS2 = 1 20K = 1 / (tq(3 + 1 + 1) 20K * 5 = 1 / tq 100K = 1 / ((BRP + 1) * tPCLK) - tPCLK = APB1 = 1/36MHz = 27ns 1 / 100K = (BRP + 1) * 27ns 10us / 27ns = BRP + 1 BRP = 360 - 1 BRP = 359 is right calculation?2011-05-17 04:08 AM
your calculation is correct , but you have to respect the standard rule : 8=
I suggest you to use BRP = 149 TS1 = 7 TS2 = 2 attached an xls file tio calculate the Baudrate Amin [ This message was edited by: amin.agina on 17-05-2009 19:24 ]2011-05-17 04:08 AM
Dear Amin,
Can you reattach the xls file as I'm after the correct setting on the STM32F103 for 500kbps and 250kbps CAN. I get a bit error every now an then. Do you? Regards, PB