beautypg.com

Timer/counter0, Timer/counter prescaler, Attiny28l/v – Rainbow Electronics ATtiny28L User Manual

Page 23

background image

23

ATtiny28L/V

1062E–10/01

Timer/Counter0

The ATtiny28 provides one general-purpose 8-bit Timer/Counter – Timer/Counter0.
Timer/Counter0 has prescaling selection from the 10-bit prescaling timer. The
Timer/Counter0 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 20 shows the Timer/Counter prescaler.

Figure 20. Timer/Counter0 Prescaler

The four different prescaled selections are: the hardware modulator period, CK/64,
CK/256 and CK/1028, where CK is the oscillator clock. CK, external source and stop
can also be selected as clock sources.

Figure 21 shows the block diagram for Timer/Counter0.

Figure 21. Timer/Counter0 Block Diagram

10-BIT T/C PRESCALER

0

TIMER/COUNTER0 CLOCK SOURCE

TCK0

CK

T0

CS00

CS01

CS02

CK/256

CK/1024

CK/64

COUNT ENABLE

FROM MODULATOR

T/C0 OVER-

FLOW IRQ

INTERRUPT FLAG

REGISTER (IFR)

T/C0 CONTROL

REGISTER (TCCR0)

TIMER/COUNTER0

(TCNT0)

CONTROL

LOGIC

TO

V

0

INTERRUPT CONTROL

REGISTER (ICR)

T

O

IE0

TO

V

0

T0