
139
8210C–AVR–09/11
Atmel AVR XMEGA D
Figure 12-6.
Normal operation.
As shown in
, it is possible to change the counter value when the counter is running.
The write access has higher priority than count, clear, or reload, and will be immediate. The
direction of the counter can also be changed during normal operation.
Normal operation must be used when using the counter as timer base for the capture channels.
12.6.2
Event Action Controlled Operation
The event selection and event action settings can be used to control the counter from the event
system. For the counter, the following event actions can be selected:
• Event system controlled up/down counting
• Event system controlled quadrature decode counting
12.6.3
32-bit Operation
Two timer/counters can be used together to enable 32-bit counter operation. By using two
timer/counters, the overflow event from one timer/counter (least-significant timer) can be routed
via the event system and used as the clock input for another timer/counter (most-significant
timer).
12.6.4
Changing the Period
The counter period is changed by writing a new TOP value to the period register. If double buff-
ering is not used, any period update is immediate, as shown in
Figure 12-7.
Changing the period without buffering.
CNT
BOTTOM
MAX
"update"
TOP
CNT written
DIR
CNT
MAX
New TOP written to
PER that is higher
than current CNT
Counter Wraparound
New TOP written to
PER that is lower
than current CNT
"update"
"write"
BOTTOM