ATmega88PA Automotive Atmel Corporation, ATmega88PA Automotive Datasheet - Page 145

no-image

ATmega88PA Automotive

Manufacturer Part Number
ATmega88PA Automotive
Description
Manufacturer
Atmel Corporation
18.4
9223B–AVR–09/11
Counter Unit
The main part of the 8-bit Timer/Counter is the programmable bi-directional counter unit.
ure 18-2 on page 145
Figure 18-2. Counter Unit Block Diagram
Signal description (internal signals):
Depending on the mode of operation used, the counter is cleared, incremented, or decre-
mented at each timer clock (clk
source, selected by the Clock Select bits (CS22:0). When no clock source is selected (CS22:0
= 0) the timer is stopped. However, the TCNT2 value can be accessed by the CPU, regardless
of whether clk
count operations.
The counting sequence is determined by the setting of the WGM21 and WGM20 bits located
in the Timer/Counter Control Register (TCCR2A) and the WGM22 located in the Timer/Coun-
ter Control Register B (TCCR2B). There are close connections between how the counter
behaves (counts) and how waveforms are generated on the Output Compare outputs OC2A
and OC2B. For more details about advanced counting sequences and waveform generation,
see
The Timer/Counter Overflow Flag (TOV2) is set according to the mode of operation selected
by the WGM22:0 bits. TOV2 can be used for generating a CPU interrupt.
“Modes of Operation” on page
Atmel ATmega48PA/88PA/168PA [Preliminary]
count
direction
clear
clk
top
bottom
Tn
DATA BUS
TCNTn
T2
is present or not. A CPU write overrides (has priority over) all counter clear or
shows a block diagram of the counter and its surrounding environment.
Increment or decrement TCNT2 by 1.
Selects between increment and decrement.
Clear TCNT2 (set all bits to zero).
Timer/Counter clock, referred to as clk
Signalizes that TCNT2 has reached maximum value.
Signalizes that TCNT2 has reached minimum value (zero).
direction
T2
count
clear
). clk
bottom
149.
Control Logic
T2
can be generated from an external or internal clock
top
TOVn
(Int.Req.)
clk Tn
Prescaler
T2
in the following.
Oscillator
T/C
clk I/O
TOSC2
TOSC1
Fig-
145

Related parts for ATmega88PA Automotive