Datasheet

Table Of Contents
85
2570N–AVR–05/11
ATmega325/3250/645/6450
15. 8-bit Timer/Counter0 with PWM
15.1 Features
Timer/Counter0 is a general purpose, single compare unit, 8-bit Timer/Counter module. The
main features are:
Single Compare Unit 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 (TOV0 and OCF0A)
15.2 Overview
A simplified block diagram of the 8-bit Timer/Counter is shown in Figure 15-1. For the actual
placement of I/O pins, refer to “Pinout ATmega3250/6450” on page 2 and “Pinout
ATmega325/645” 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 96.
Figure 15-1. 8-bit Timer/Counter Block Diagram
15.2.1 Definitions
Many register and bit references in this section are written in general form. A lower case “n”
replaces the Timer/Counter number, in this case 0. A lower case “x” replaces the Output Com-
pare unit number, in this case unit A. However, when using the register or bit defines in a
program, the precise form must be used, i.e., TCNT0 for accessing Timer/Counter0 counter
value and so on.
Timer/Counter
DATA BU S
=
TCNTn
Waveform
Generation
OCn
= 0
Control Logic
=
0xFF
BOTTOM
count
clear
direction
TOVn
(Int.Req.)
OCRn
TCCRn
Clock Select
Tn
Edge
Detector
( From Prescaler )
clk
Tn
TOP
OCn
(Int.Req.)