2 Timer/Counter A (TCA)

TCA is a timer optimized for generating Pulse-Width Modulation (PWM). It can operate in 16-bit mode for high-resolution output or 2x 8-bit mode, where each half of the timer operates independently. The counter runs until the TOP value is reached. When this occurs, the counter resets to the BOTTOM value (zero), except in Dual-Slope mode. In Dual-Slope mode, the counter does not reset to zero but instead will count to zero to reset the cycle, as shown in the figure below.

Figure 2-1. TCA Counter Behavior

Use compare channels to check if the counter matches or exceeds the set value to generate a PWM signal. If so, the associated output is driven high. This timer also supports double buffering, where the values written to the counter are held until the timer triggers an update, which varies by operating mode. With the Event System (EVSYS), more advanced control is possible. For instance, the event system can gate the input, count event edges, control the counting direction (up or down), and restart the timer under various conditions.