SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The timer is an upward counter that can be started and stopped at any time through the timer control register (the TIMER_TCLR[0] ST bit). The timer counter register (TIMER_TCRR) can be loaded when stopped or on-the-fly (while counting). TIMER_TCRR can be loaded directly by a TIMER_TCRR write access with a new timer value. TIMER_TCRR can also be loaded with the value held in the timer load register (TIMER_TLDR) by a trigger register (TIMER_TTGR) write access. The loading of TIMER_TCRR is done regardless of the written value of TIMER_TTGR. The value of TIMER_TCRR can be read when stopped or captured on-the-fly by a TIMER_TCRR read access. The timer is stopped and the counter value is set to 0 when the module reset is asserted. The timer is maintained at stop after the reset is released.
In one-shot mode (the TIMER_TCLR[1] AR bit is set to 0), the counter is stopped after counting overflow occurs (the counter value remains at 0).
When the autoreload mode is enabled (the TIMER_TCLR[1] AR bit is set to 1), TIMER_TCRR is reloaded with the value of TIMER_TLDR after a counting overflow occurs.
Do not put the overflow value (0xFFFF FFFF) in the TIMER_TLDR register because it can lead to undesirable results.
An interrupt can be issued on overflow if the overflow interrupt-enable bit is set in the timer interrupt-enable register (the TIMER_IRQSTATUS_SET[1] OVF_EN_FLAG bit is set to 1). A dedicated output pin (POTIMERPWM) can be programmed in the TIMER_TCLR[12] PT bit through the TIMER_TCLR[11-10] (PT and TRG bits) to generate one positive pulse (prescaler duration) or to invert the current value (toggle mode) when an overflow occurs. The TIMER_TCLR[12] PT bit selects pulse/toggle modulation (the TIMER_TCLR[11-10] TRG bit field selects trigger mode).
Figure 12-2475 shows the TIMER_TCRR timing value.