217
8331B–AVR–03/12
Atmel AVR XMEGA AU
17. Hi-Res – High-Resolution Extension
17.1
Features
•
Increases waveform generator resolution up to 8x (3 bits)
•
Supports frequency, single-slope PWM, and dual-slope PWM generation
•
Supports the AWeX when this is used for the same timer/counter
17.2
Overview
The high-resolution (hi-res) extension can be used to increase the resolution of the waveform
generation output from a timer/counter by four or eight. It can be used for a timer/counter doing
frequency, single-slope PWM, or dual-slope PWM generation. It can also be used with the
AWeX if this is used for the same timer/counter.
The hi-res extension uses the peripheral 4x clock (Clk
PER4
). The system clock prescalers must
be configured so the peripheral 4x clock frequency is four times higher than the peripheral and
CPU clock frequency when the hi-res extension is enabled. Refer to
Figure 17-1.
Timer/counter operation with hi-res extension enabled.
When the hi-res extension is enabled, the timer/counter must run from a non-prescaled periph-
eral clock. The timer/counter will ignore its two least-significant bits (lsb) in the counter, and
counts by four for each peripheral clock cycle. Overflow/underflow and compare match of the 14
most-significant bits (msb) is done in the timer/counter. Count and compare of the two lsb is han-
dled and compared in the hi-res extension running from the peripheral 4x clock.
The two lsb of the timer/counter period register must be set to zero to ensure correct operation.
If the count register is read from the application code, the two lsb will always be read as zero,
since the timer/counter run from the peripheral clock. The two lsb are also ignored when gener-
ating events.
When the hi-res plus feature is enabled, the function is the same as with the hi-res extension,
but the resolution will increase by eight instead of four. This also means that the 3 lsb are han-
dled by the hi-res extension instead of 2 lsb, as when only hi-res is enabled. The extra resolution
is achieved by counting on both edges of the peripheral 4x clock.
CNT[15:2]
HiRes
CCxBUF[15:0]
=
= 0
" match"
=
PER[15:2]
0
Waveform
Generation
TOP
BOTTOM
Time /Counter
CCx[15:2]
[1:0]
2
2
2
0
AWeX
Fault
Protection
Dead - Time
Insertion
Pattern
Generation
clk
PER
clk
PER4
Pxn