TTCAN TUR division: rounding or truncating?
This is a request for clarification of the TUR (Time Unit Ratio) calculation in the TTCAN implementation of the FD-CAN peripheral that is part of STM32MP1xxx systems.
Specifically: the TUR is composed of a numerator and a denominator, designated FDCAN_TURNA.NAV and FDCAN_TURCF.DC, respectively, in the documentation.
For example, see RM0436 pages 2994-2995.
The calculation of the NTU (Network Time Unit) is NTU = clock_period * (TUR.numerator / TUR.denominator)
My question: is the division a rounding division or a truncating division? The documentation does not specify this.
As a concrete example, I am analyzing a TTCAN system using the STM32MP157 FD-CAN1 peripheral with:
- numerator = 0x1ffff (= 131071, the maximum allowed)
- denominator = 8192
With rounding division, TUR = 16, with truncating division, TUR = 15.
Truncating divisions are more common in hardware, so what is the FD-CAN1 peripheral using for its TUR calculation?
Any clarification would be appreciated.
Thanks in advance.
