161
XMEGA B [DATASHEET]
8291B–AVR–01/2013
Figure 13-14.Frequency waveform generation.
The waveform frequency (f
FRQ
) is defined by the following equation:
where N represents the prescaler divider used. The waveform generated will have a maximum frequency of half of the
peripheral clock frequency (fclk
PER
) when CCA is set to zero (0x0000) and no prescaling is used. This also applies when
using the hi-res extension, since this increases the resolution and not the frequency.
13.8.3 Single-slope PWM Generation
For single-slope PWM generation, the period (T) is controlled by PER, while CCx registers control the duty cycle of the
WG output.
shows how the counter counts from BOTTOM to TOP and then restarts from BOTTOM. The
waveform generator (WG) output is set on the compare match between the CNT and CCx registers and cleared at TOP.
Figure 13-15.Single-slope pulse width modulation.
The PER register defines the PWM resolution. The minimum resolution is 2 bits (PER=0x0003), and the maximum
resolution is 16 bits (PER=MAX).
The following equation calculate the exact resolution for single-slope PWM (R
PWM_SS
):
The single-slope PWM frequency (f
PWM_SS
) depends on the period setting (PER) and the peripheral clock frequency
(fclk
PER
), and can be calculated by the following equation:
CNT
MAX
"update"
TOP
CNT written
Direction Change
Period (T)
BOTTOM
WG Output
f
FRQ
fclk
PER
2
N CCA
1
+
-----------------------------------
=
CNT
MAX
TOP
Period (T)
"match"
BOTTOM
WG Output
CCx=BOTTOM
CCx
CCx=TOP
"update"
R
PWM_SS
PER
1
+
log
2
log
---------------------------------
=
Summary of Contents for XMEGA B
Page 320: ...320 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 12 7 segments Character Table...
Page 321: ...321 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 13 14 segments Character Table...
Page 322: ...322 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 14 16 segments Character Table...
Page 412: ...412 XMEGA B DATASHEET 8291B AVR 01 2013...
Page 413: ...413 XMEGA B DATASHEET 8291B AVR 01 2013...