95
AT94KAL Series FPSLIC
Rev. 1138G–FPSLI–11/03
of the timer clock, that is, the timer is always advanced by at least one before the
processor can read the counter value. The interrupt flags are updated three processor
cycles after the processor clock has started. During these cycles, the processor executes
instructions, but the interrupt condition is not readable, and the interrupt routine has not
started yet.
•
During asynchronous operation, the synchronization of the interrupt flags for the
asynchronous timer takes three processor cycles plus one timer cycle. The timer is
therefore advanced by at least one before the processor can read the timer value causing
the setting of the interrupt flag. The output compare pin is changed on the timer clock and
is not synchronized to the processor clock.
Timer/Counter1
Figure 54 shows the block diagram for Timer/Counter1.
Figure 54.
Timer/Counter1 Block Diagram
TOIE0
TOIE1
OCIE1A
OCIE1B
TICIE1
TOIE2
OCIE2
OCIE0
TOV0
TOV1
OCF1A
OCF1B
ICF1
TOV2
OCF2
OCF0
TIMER INT. FLAG
REGISTER (TIFR)
CONTROL
LOGIC
TIMER/COUNTER1 (TCNT1)
TIMER INT. MASK
REGISTER (TIMSK)
T/C1 INPUT CAPTURE REGISTER (ICR1)
T/C1 OVER-
FLOW IRQ
T/C1 COMPARE
MATCHA IRQ
T/C1 COMPARE
MATCHB IRQ
T/C1 INPUT
CAPTURE IRQ
8-BIT DATA BUS
16 BIT COMPARATOR
TIMER/COUNTER1 OUTPUT COMPARE REGISTER A
16 BIT COMPARATOR
TIMER/COUNTER1 OUTPUT COMPARE REGISTER B
CAPTURE
TRIGGER
CK
0
7
8
15
0
7
8
15
0
7
8
15
0
7
8
15
0
7
8
15
0
7
8
15
T/C CLEAR
T/C CLOCK SOURCE
UP/DOWN
T/C1 CONTROL
REGISTER A (TCCR1A)
T/C1 CONTROL
REGISTER B (TCCR1B)
FOC1A
FOC1B
COM1A1
COM1A0
COM1B1
COM1B0
PWM11
PWM10
ICNC1
ICES1
CTC1
CS12
CS11
CS10
PSR2
PSR10
SPECIAL FUNCTIONS
IO REGISTER (SFIOR)
TOV1
OCF1B
OCF1A
ICF1
TOV2
OCF2
OCF0
TOV0
T1