English
Language : 

XMEGAA_09 Datasheet, PDF (162/445 Pages) ATMEL Corporation – Interrupts and Programmable Multi-level Interrupt Controller
XMEGA A
Figure 14-14. Dual-slope Pulse Width Modulation
CNT
MAX
TOP
Period (T)
CCx
CCx=BOT
CCx=TOP
"update"
"match"
BOT
WG Output
Using dual-slope PWM result in a lower maximum operation frequency compared to the single-
slope PWM operation.
The period register (PER) defines the PWM resolution. The minimum resolution is 2-bit
(PER=0x0003), and maximum resolution is 16-bit (PER=MAX).
The following equation can be used for calculate the exact resolution for dual-slope PWM
(RPWM_DS):
RPWM_DS = l--o---g----(-l-o-P---g-E--(--R-2----)+-----1----)
The PWM frequency depends on the period setting (PER) and the Peripheral Clock frequency
(fPER), and can be calculated by the following equation:
fPWM_DS
=
-----f--P---E---R------
2NPER
N represents the prescaler divider used (1, 2, 4, 8, 64, 256, 1024, or event channel n).
14.8.5
Port override for Waveform Generation
To make the waveform generation available on the port pins the corresponding port pin direction
must be set as output. The Timer/Counter will override the port pin values when the CC channel
is enabled (CCENx) and a waveform generation mode is selected.
Figure 14-15 on page 163 shows the port override for Timer/Counter 0 and 1. For Timer/Counter
1, CC channel A to D will override port pin 0 to 3 output value (OUTxn) on the corresponding
port pin (Pxn). For Timer/Counter 1, CC channel A and B will override port pin 4 and 5. Enabling
inverted I/O on the port pin (INVENxn) inverts the corresponding WG output.
8077H–AVR–12/09
162