Interrupts And Events - Atmel AVR XMEGA AU series Manual

8-bit microcontroller
Table of Contents

Advertisement

15.6.3
Port Override for Waveform Generation
15.7

Interrupts and Events

8331B–AVR–03/12
The PER register defines the PWM resolution. The minimum resolution is two bits
(PER=0x0003), and the maximum resolution is eight bits (PER=MAX).
The following equation is used to calculate the exact resolution for a single-slope PWM
(R
) waveform:
PWM_SS
(
)
log
PER
+
1
R
=
---------------------------------- -
2 ( )
PWM_SS
log
The single, slow PWM frequency (f
eral clock frequency (f
PER
f
PER
f
=
------------------------------ -
(
)
PWM_SS
N PER
+
1
where N represents the prescaler divider used (1, 2, 4, 8, 64, 256, 1024, or event channel n).
To make the waveform generation available on the port pins, the corresponding port pin direc-
tion must be set as output. The timer/counter will override the port pin values when the CMP
channel is enabled (LCMPENx/HCMPENx).
Figure 15-6 on page 197
the low-byte timer/counter, CMP channels A to D will override the output value (OUTxn) of port
pins 0 to 3 on the corresponding port pins (Pxn). For the high-byte timer/counter, CMP channels
E to H will override port pins 4 to 7. Enabling inverted I/O on the port pin (INVENxn) inverts the
corresponding WG output.
Figure 15-6. Port override for low- and high-byte timer/counters.
Waveform
The timer/counters can generate interrupts and events. The counter can generate an interrupt
on underflow, and each CMP channel for the low-byte counter has a separate compare interrupt.
Events will be generated for all conditions that can generate interrupts. For details on event gen-
eration and available events, refer to
) depends on the period setting (PER) and the periph-
PWM_SS
), and it is calculated by using the following equation:
shows the port override for the low- and high-byte timer/counters. For
OUT
LCMPENx /
HCMPENx
"Event System" on page
Atmel AVR XMEGA AU
INVEN
71.
OCx
197

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AVR XMEGA AU series and is the answer not in the manual?

Table of Contents