Datasheet
42
ATmega323(L)
1457E–11/01
Timer/Counters The ATmega323 provides three general-purpose Timer/Counters – two 8-bit T/Cs and
one 16-bit T/C. Timer/Counter2 can optionally be asynchronously clocked from an exter-
nal oscillator. This oscillator is optimized for use with a 32.768 kHz watch crystal,
enabling use of Timer/Counter2 as a Real Time Counter (RTC). Timer/Counters 0 and 1
have individual prescaling selection from the same 10-bit prescaler. Timer/Counter2 has
its own prescaler. Both these prescalers can be reset by setting the corresponding con-
trol bits in the Special Functions IO Register (SFIOR). 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 which triggers the counting.
Timer/Counter
Prescalers
Figure 30. Prescaler for Timer/Counter0 and Timer/Counter1
For Timer/Counters 0 and 1, the four different prescaled selections are: CK/8, CK/64,
CK/256, and CK/1024, where CK is the oscillator clock. For the two Timer/Counters 0
and 1, CK, external source, and stop can also be selected as clock sources. Setting the
PSR10 bit in SFIOR resets the prescaler. This allows the user to operate with a predict-
able prescaler. Note that Timer/Counter1 and Timer/Counter 0 share the same
prescaler and a prescaler reset will affect both Timer/Counters.
PSR10
Clear
TCK1 TCK0