
30
8068C–AVR–06/08
XMEGA A3
15. T/C - 16-bits Timer/Counter with PWM
15.1
Features
•
Seven 16-bit Timer/Counters
– Four Timer/Counters of type 0
– Three Timer/Counters of type 1
•
Four Compare or Capture (CC) Channels in Timer/Counter 0
•
Two Compare or Capture (CC) Channels in Timer/Counter 1
•
Double Buffered Timer Period Setting
•
Double Buffered Compare or Capture Channels
•
Waveform Generation:
– Single Slope Pulse Width Modulation
– Dual Slope Pulse Width Modulation
– Frequency Generation
•
Input Capture:
– Input Capture with Noise Cancelling
– Frequency capture
– Pulse width capture
– 32-bit input capture
•
Event Counter with Direction Control
•
Timer Overflow and Timer Error Interrupts and Events
•
One Compare Match or Capture Interrupt and Event per CC Channel
•
Supports DMA Operation
•
Hi-Resolution Extension (Hi-Res)
•
Advanced Waveform Extension (AWEX)
15.2
Overview
XMEGA A3 has eight Timer/Counters, four Timer/Counter 0 and four Timer/Counter 1. The dif-
ference between them is that Timer/Counter 0 has four Compare/Capture channels, while
Timer/Counter 1 has two Compare/Capture channels.
The Timer/Counters (T/C) are 16-bit and can count any clock, event or external input in the
microcontroller. A programmable prescaler is available to get a useful T/C resolution. Updates of
Timer and Compare registers are double buffered to ensure glitch free operation. Single slope
P
W
M, dual slope P
W
M and frequency generation waveforms can be generated using the Com-
pare Channels.
Through the Event System, any input pin or event in the microcontroller can be used to trigger
input capture, hence no dedicated pins is required for this. The input capture has a noise cancel-
ler to avoid incorrect capture of the T/C, and can be used to do frequency and pulse width
measurements.
A wide range of interrupt or event sources are available, including T/C Overflow, Compare
match and Capture for each Compare/Capture channel in the T/C.
PORTC, PORTD and PORTE each has one Timer/Counter 0 and one Timer/Counter1. PORTF
has one Timer/Counter 0. Notation of these are TCC0 (Time/Counter C0), TCC1, TCD0, TCD1,
TCE0, TCE1 and TCF0, respectively.