SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The timer rate is defined by the following values:
Table 12-4720 lists the prescaler clock ratio values.
TIMER_TCLR[5] PRE | TIMER_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 – TIMER_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 TIMER_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 TIMER_TCLR[1] ST bit.
For example, with a timer clock input of 32 kHz and the TIMER_TCLR[5] PRE bit set to 0, the timer output period is as listed in Table 12-4721.
TIMER_TLDR[31-0] LOAD_VALUE | Interrupt Period |
---|---|
0x0000 0000 | 37 h |
0xFFFF 0000 | 2 s |
0xFFFF FFF0 | 500 µs |
0xFFFF FFFE | 62.5 µs |