ATMEGA325-16AJ ATMEL [ATMEL Corporation], ATMEGA325-16AJ Datasheet - Page 141

no-image

ATMEGA325-16AJ

Manufacturer Part Number
ATMEGA325-16AJ
Description
8-bit Microcontroller with In-System Programmable Flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
Timer/Counter Prescaler
2570A–AVR–09/04
(Timer/Counter2 Compare match Interrupt Enable), and OCF2A are set (one), the
Timer/Counter2 Compare match Interrupt is executed.
• Bit 0 – TOV2: Timer/Counter2 Overflow Flag
The TOV2 bit is set (one) when an overflow occurs in Timer/Counter2. TOV2 is cleared
by hardware when executing the corresponding interrupt handling vector. Alternatively,
TOV2 is cleared by writing a logic one to the flag. When the SREG I-bit, TOIE2A
(Timer/Counter2 Overflow Interrupt Enable), and TOV2 are set (one), the
Timer/Counter2 Overflow interrupt is executed. In PWM mode, this bit is set when
Timer/Counter2 changes counting direction at 0x00.
Figure 64. Prescaler for Timer/Counter2
The clock source for Timer/Counter2 is named clk
the main system I/O clock clk
chronously clocked from the TOSC1 pin. This enables use of Timer/Counter2 as a Real
Time Counter (RTC). When AS2 is set, pins TOSC1 and TOSC2 are disconnected from
Port C. A crystal can then be connected between the TOSC1 and TOSC2 pins to serve
as an independent clock source for Timer/Counter2. The Oscillator is optimized for use
with a 32.768 kHz crystal. If applying an external clock on TOSC1, the EXCLK bit in
ASSR must be set.
For Timer/Counter2, the possible prescaled selections are: clk
clk
selected. Setting the PSR2 bit in GTCCR resets the prescaler. This allows the user to
operate with a predictable prescaler.
TOSC1
T2S
clk
PSR2
CS20
CS21
CS22
AS2
/128, clk
I/O
T2S
/256, and clk
clk
T2S
IO
. By setting the AS2 bit in ASSR, Timer/Counter2 is asyn-
T2S
Clear
/1024. Additionally, clk
ATmega325/3250/645/6450
TIMER/COUNTER2 CLOCK SOURCE
0
10-BIT T/C PRESCALER
T2S
clk
. clk
T2
T2S
T2S
as well as 0 (stop) may be
is by default connected to
T2S
/8, clk
T2S
/32, clk
T2S
/64,
141

Related parts for ATMEGA325-16AJ