beautypg.com

Timer/counter1 prescaler, Bit timer/counter0, Attiny26(l) – Rainbow Electronics ATtiny26L User Manual

Page 45

background image

45

ATtiny26(L)

1477B–AVR–04/02

Timer/Counter1
Prescaler

Figure 32 shows the Timer/Counter1 prescaler. For Timer/Counter1 the clock selections
are between PCK to PCK/16384 and stop in asynchronous mode and CK to CK/16384
and stop in synchronous. The clock options are described in Table 24 on page 52 and
the Timer/Counter1 Control Register, TCCR1B. Setting the PSR1 bit in TCCR1B Regis-
ter resets the prescaler. The PCKE bit in the PLLCSR Register enables the
asynchronous mode.

Figure 32. Timer/Counter1 Prescaler

8-bit Timer/Counter0

Figure 33 shows the block diagram for Timer/Counter0.

The 8-bit Timer/Counter0 can select clock source from CK, prescaled CK, or an external
pin. In addition, it can be stopped as described in the specification for the
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 ensure 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.

TIMER/COUNTER1 COUNT ENABLE

PSR1

CS10

CS11

CS12

PCK

(64 MHz)

0

CS13

14-BIT

T/C PRESCALER

T1CK/2

T1CK

T1CK/4

T1CK/8

T1CK/16

T1CK/32

T1CK/64

T1CK/128

T1CK/256

T1CK/512

T1CK/1024

T1CK/2048

T1CK/4096

T1CK/8192

T1CK/16384

S
A

CK

PCKE

T1CK