Good day,
The datasheet lacks clarity when it comes to the quantization error correction of TS_TIMER. The (now removed) driver that was initially available also incorrectly implemented the quantization error correction.
From page 30 of rev. C of the datasheet (see also page 63):
"Because it is frequent that the required period of TS_TIMER cannot
be programmed as a multiple of 16, the quantization error correc-
tion register can be programmed with a value between 0 and 15 to
compensate for the TS_TIMER quantization error."
One would assume (as the driver did) that the total period of the TS_TIMER would be:
TS_TIMER_period = TS_TIMER_HI + TS_TIMER_LO + quantization error correction value
However, after testing and lots of head-scratching, it turns out it is as follows:
TS_TIMER_period = TS_TIMER_HI + TS_TIMER_LO - (16 - quantization error correction value)
In other words, the value of (TS_TIMER_HI + TS_TIMER_LO) should be greater than the desired period (by 16) so that the subraction of the quantization error correction value will lead to the desired period.
Clarity around this in the datasheet would save some head-scratching for anyone else trying to make use of the TS_TIMER.