85
AT94KAL Series FPSLIC
Rev. 1138G–FPSLI–11/03
Timer/Counters
The FPSLIC 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 external oscillator.
This oscillator is optimized for use with a 32.768 kHz watch crystal, enabling use of
Timer/Counter2 as a Real-time Clock (RTC). Timer/Counters 0 and 1 have individual prescal-
ing selection from the same 10-bit prescaling timer. Timer/Counter2 has its own prescaler.
Both these prescalers can be reset by setting the corresponding control bits in the Special
Functions I/O Register (SFIOR). See “Special Function I/O Register – SFIOR” on page 86 for
a detailed description. 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
For Timer/Counters 0 and 1, see Figure 48, the four 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 predictable prescaler. Note
that Timer/Counter1 and Timer/Counter0 share the same prescaler and a prescaler reset will
affect both Timer/Counters.
Figure 48.
Prescaler for Timer/Counter0 and 1
The clock source for Timer/Counter2 prescaler, see Figure 49, is named PCK2. PCK2 is by
defau lt conne cte d to th e m ain system clo ck CK. By setting the AS2 bit in ASSR,
Timer/Counter2 is asynchronously clocked from the TOSC1 pin. This enables use of
Timer/Counter2 as a Real-time Clock (RTC). When AS2 is set, pins TOSC1 and TOSC2 are
disconnected from Port D. 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. Alternatively, an external clock signal can be applied to
TOSC1. The frequency of this clock must be lower than one fourth of the CPU clock and not
higher than 1 MHz. Setting the PSR2 bit in SFIOR resets the prescaler. This allows the user to
operate with a predictable prescaler.
PSR10
Clear
TCK1
TCK0