Datasheet
77
8024A–AVR–04/08
ATmega8HVA/16HVA
17. Timer/Counter(T/C0,T/C1)
17.1 Features
• Clear Timer on Compare Match (Auto Reload)
• Input Capture unit
• Four Independent Interrupt Sources (TOVn, OCFnA, OCFnB, ICFn)
• 8-bit Mode with Two Independent Output Compare Units
• 16-bit Mode with One Independent Output Compare Unit
17.2 Overview
Timer/Counter n is a general purpose 8-/16-bit Timer/Counter module, with one/two Output
Compare units and Input Capture functionality.
ATmega8HVA/16HVA has two Timer/Counters, Timer/Counter0 and Timer/Counter1. The func-
tionality for both Timer/Counters is described below. Timer/Counter0 and Timer/Counter1 have
different Timer/Counter registers, as shown in ”Register Summary” on page 175.
The Timer/Counter general operation is described in 8-/16-bit mode. A simplified block diagram
of the 8-/16-bit Timer/Counter is shown in Figure 17-1. 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 90.
Figure 17-1. 8-/16-bit Timer/Counter Block Diagram
Clock Select
Timer/Counter
DATA BU S
OCRnB
=
TCNTnL
Noise
Canceler
ICPn0
=
Edge
Detector
Control Logic
TOP
Count
Clear
Direction
TOVn (Int. Req.)
OCnA (Int. Req.)
OCnB (Int. Req.)
ICFn (Int. Req.)
TCCRnA TCCRnB
Tn
Edge
Detector
( From Prescaler )
clk
Tn
=
OCRnA
TCNTnH
Fixed TOP value
ICPn1