Why the SysTick Calibration TENMS value is one less than the number of clock cycles required for 10ms
Article ID: 103490418
Published date: 24 Jul 2017
Last updated: -
Applies to: Cortex-M
Why is the SysTick Calibration TENMS value one less than the number of clock cycles required for 10ms?
The TENMS field is defined as the reload value for the counter that will yield a 10ms period.
Because the counter is an (n-1) down-to-zero counter, the TENMS field must be programmed to be one less than the number of cycles that make up the 10ms period.
To scale the counter to a different time interval the software must calculate a new reload value for the TENMS register field:
Read the TENMS value.
Increment this value by 1.
Scale the result by the correct factor for the different time interval.
Subtract 1 from the result to obtain the new reload register value.