pierremolinaro / acan-t4

CAN / CANFD Arduino Library for Teensy 4.0
MIT License
17 stars 4 forks source link

Fixed wrong assignment of `FLEXCAN_FDCBT_PROPSEG` #2

Closed tyalie closed 3 years ago

tyalie commented 3 years ago

According to the processor manual, the prop seg timeout is calculated from the FDCBT_PROPSEG value by multiplying it with the sclock directly. The value is not increased by one beforehand¹.

In the reference manual the calculation of the segment time is stated as: Propagation Segment Time = FPROPSEG × Time-Quanta

This is indeed different to the programming of the CAN2.0 Interface (CBT_PROPSEG)², where the calculation is: Propagation Segment Time = (EPROPSEG + 1) × Time-Quanta.

Without this commit the actual frequency, with which the BRS packages are send, is to high.

Sources: ¹: i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019 / Chapter 45.6.2.22.4 / Page 2701 ²: i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019 / Chapter 45.6.2.19.4 / Page 2695

pierremolinaro commented 3 years ago

You are right, I make a new release.

Thank you very much!

Best Regards,

Pierre Molinaro