English
Language : 

ATMEGA128A_14 Datasheet, PDF (142/369 Pages) ATMEL Corporation – 8-bit Microcontroller with 128Kbytes
17. 8-bit Timer/Counter2 with PWM
17.1
Features
• Single Channel Counter
• Clear Timer on Compare Match (Auto Reload)
• Glitch-free, Phase Correct Pulse width Modulator (PWM)
• Frequency Generator
• External Event Counter
• 10-bit Clock Prescaler
• Overflow and Compare Match Interrupt Sources (TOV2 and OCF2)
17.2
Overview
Timer/Counter2 is a general purpose, single channel, 8-bit Timer/Counter module. A simplified block diagram of
the 8-bit Timer/Counter is shown in Figure 17-1. For the actual placement of I/O pins, refer to “Pin
Configurations” on page 3. CPU accessible I/O registers, including I/O bits and I/O pins, are shown in bold. The
device-specific I/O register and bit locations are listed in the “Register Description” on page 152.
Figure 17-1. 8-Bit Timer/Counter Block Diagram
TCCRn
count
clear
direction
Control Logic
BOTTOM
TOP
Timer/Counter
TCNTn
= 0 = 0xFF
=
clkTn
Clock Select
Edge
Detector
TOVn
(Int.Req.)
Tn
( From Prescaler )
Waveform
Generation
OCn
(Int.Req.)
OCn
OCRn
17.2.1 Registers
The Timer/Counter (TCNT2) and Output Compare Register (OCR2) are 8-bit registers. Interrupt request
(abbreviated to Int.Req. in the figure) signals are all visible in the Timer Interrupt Flag Register (TIFR). All
ATmega 128A [DATASHEET]
Atmel-8151I-8-bit-AVR-ATmega128A_Datasheet-08/2014
142