35
ATmega103(L)
0945G–09/01
Timer/Counters
The ATmega103(L) provides three general-purpose Timer/Counters – two 8-bit T/Cs
and one 16-bit T/C. Timer/Counter0 optionally can be asynchronously clocked from an
external oscillator. This oscillator is optimized for use with a 32.768 kHz crystal, enabling
use of Timer/Counter0 as a Real-time Clock (RTC). Timer/Counter0 has its own pres-
caler. Timer/Counters 1 and 2 have individual prescaling selection from the same 10-bit
prescaling timer. These Timer/Counters can either be used as a timer with an internal
clock time base or as a counter with an external pin connection that triggers the
counting.
Timer/Counter
Prescalers
Figure 28.
Prescaler for Timer/Counter1 and Timer/Counter2
For Timer/Counters 1 and 2, the four different prescaled selections are: CK/8, CK/64,
CK/256 and CK/1024, where CK is the CPU clock. Observe that CPU clock frequency
c a n b e l owe r t ha n th e X TA L f req u e nc y i f t h e X TA L d iv id e r i s en a bl ed . F or
Timer/Counters 1 and 2, added selections as CK, external source and stop can be
selected as clock sources.
Figure 29.
The Timer/Counter0 Prescaler
10-BIT T/C PRESCALER
TIMER/COUNTER2 CLOCK SOURCE
TCK2
TIMER/COUNTER1 CLOCK SOURCE
TCK1
CK
T2
T1
CS20
CS10
CS21
CS11
CS22
CS12
CK/8
CK/256
CK/1024
CK/64
0
0
10-BIT T/C PRESCALER
TIMER/COUNTER0 CLOCK SOURCE
PCK0
CK
PCK0
TOSC1
AS0
CS00
CS01
CS02
PCK0/8
PCK0/64
PCK0/128
PCK0/1024
PCK0/256
PCK0/32