TCA - Timer/Counter Type A

The Timer Counter type A (TCA) is an improved version of Timer 0 of megaAVR devices. The TCA consists of a base counter and a set of compare channels. The compare channels can be used together with the base counter to do a compare match control, frequency generation, and pulse-width waveform modulation.

Unlike Timer 0 of the megaAVR devices, which is an 8-bit timer, the TCA is a 16-bit timer/counter with three compare channels. It can be clocked and timed from the peripheral clock, with optional prescaling, or from the Event System. The Event System can also be used for direction control or to synchronize operations.

Figure 1. AVR® Dx - TCA Block Diagram

Additionally, the TCA has a Split mode feature that splits the 16-bit timer into two separate 8-bit timers, each having three compare channels for PWM generation. The Split mode will only work with single-slope down-count. The event controlled operation is not supported in Split mode.

The following subsection will show a few possible use cases for the TCA.