23.3.4.1 Normal Operation

In normal operation the counter counts clock ticks in the direction selected by the Direction (DIR) bit in the Control E (TCEn.CTRLE) register until it reaches TOP or BOTTOM. The clock ticks are given by the peripheral clock (CLK_PER), prescaled according to the Clock Select (CLKSEL) bit field in the Control A (TCEn.CTRLA) register. Alternatively, the Timer/Counter can count on event input.

When reaching TOP while the counter is counting up, the counter will wrap to ‘0’ at the next clock tick. When counting down, the counter is reloaded with the Period (TCEn.PER) register value when the BOTTOM is reached.

Figure 23-3. Normal Operation

The counter value in the Counter (TCEn.CNT) register can be changed while the counter is running. The write access to the TCEn.CNT register has higher priority than count, clear or reload and will be immediate. The direction of the counter can also be changed during normal operation by writing to the Direction (DIR) bit in the Control E (TCEn.CTRLE) register.