Datasheet

87
ATtiny828 [DATASHEET]
8371A–AVR–08/12
11. 8-bit Timer/Counter0 with PWM
11.1 Features
z Two Independent Output Compare Units
z Double Buffered Output Compare Registers
z Clear Timer on Compare Match (Auto Reload)
z Glitch Free, Phase Correct Pulse Width Modulator (PWM)
z Variable PWM Period
z Frequency Generator
z Three Independent Interrupt Sources (TOV0, OCF0A, and OCF0B)
11.2 Overview
Timer/Counter0 is a general purpose 8-bit Timer/Counter module, with two independent Output Compare Units, and with
PWM support. It allows accurate program execution timing (event management) and wave generation.
A simplified block diagram of the 8-bit Timer/Counter is shown in Figure 26. 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 97.
Figure 26. 8-bit Timer/Counter Block Diagram
Clock Select
Timer/Counter
DATA BUS
OCRnA
OCRnB
=
=
TCNTn
Waveform
Generation
Waveform
Generation
OCnA
OCnB
=
Fixed
TOP
Value
Control Logic
= 0
TOP BOTTOM
Count
Clear
Direction
TOVn
(Int.Req.)
OCnA
(Int.Req.)
OCnB
(Int.Req.)
TCCRnA TCCRnB
Tn
Edge
Detector
( From Prescaler )
clk
Tn