SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
The timer rate is defined by the following values:
Table 24-9 lists the prescaler clock ratio values.
| TCLR[5] PRE | TCLR[4:2] PTV | Divisor (PS) |
|---|---|---|
| 0 | X | 1 |
| 1 | 0 | 2 |
| 1 | 1 | 4 |
| 1 | 2 | 8 |
| 1 | 3 | 16 |
| 1 | 4 | 32 |
| 1 | 5 | 64 |
| 1 | 6 | 128 |
| 1 | 7 | 256 |
Thus, the timer overflow rate is expressed as:
OVF_Rate = (0xFFFF FFFF – TLDR + 1) × (timer-functional clock period) × PS
With (timer-functional clock period) = 1/(timer-functional clock frequency) and PS = 2(PTV + 1) if prescaler is enabled, or PS = 1 if prescaler is disabled.
Internal resynchronization causes any write to the TCLR[1] ST bit to have some latency before the register is updated:
2.5 × functional clock cycles write_TIMER_TCLR_latency 3.5 × functional clock cycles
Remember to consider this latency whenever the timer must be started or stopped by a software change to the TCLR[1] ST bit.
For example, with a timer clock input of 32 kHz and the TCLR[5] PRE bit set to 0, the timer output period is as listed in Table 24-10.
| TLDR[31:0] LOAD_VALUE | Interrupt Period |
|---|---|
| 0x0000 0000 | 37 h |
| 0xFFFF 0000 | 2 s |
| 0xFFFF FFF0 | 500 µs |
| 0xFFFF FFFE | 62.5 µs |