Timer/counters, Timer/counter prescaler, Bit timer/counter0 – Rainbow Electronics AT90LS4433 User Manual

Page 33

Advertising
background image

33

AT90S/LS4433

1042G–AVR–09/02

Timer/Counters

The AT90S4433 provides two general purpose Timer/Counters – one 8-bit T/C and one
16-bit T/C. Timer/Counters0 and 1 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 Prescaler

Figure 30. Prescaler for Timer/Counter0 and 1

For Timer/Counters0 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/Counters0
and 1, external source and stop can also be selected as clock sources.

8-bit Timer/Counter0

The 8-bit Timer/Counter0 can select clock source from CK, prescaled CK or an external
p in . In a dd i tio n, i t can b e sto pp ed as de scri be d i n the spe ci fica tio n fo r th e
Timer/Counter0 Control Register (TCCR0). The Overflow Status Flag is found in the
Timer/Counter Interrupt Flag Register (TIFR). Control signals are found in the
Timer/Counter0 Control Register (TCCR0). The interrupt enable/disable settings for
Timer/Counter0 are found in the Timer/Counter Interrupt Mask Register (TIMSK).

When Timer/Counter0 is externally clocked, the external signal is synchronized with the
Oscillator frequency of the CPU. To assure proper sampling of the external clock, the
minimum time between two external clock transitions must be at least one internal CPU
clock period. The external clock signal is sampled on the rising edge of the internal CPU
clock.

The 8-bit Timer/Counter0 features both a high resolution and a high-accuracy usage
with the lower prescaling opportunities. Similarly, the high prescaling opportunities make
the Timer/Counter0 useful for lower speed functions or exact timing functions with infre-
quent actions. Figure 31 shows the block diagram for Timer/Counter0.

TCK1

TCK0

Advertising