User’s Manual
7-8
05.99
Interrupt System
C513AO
Timer 2 interrupt
is generated by the logical OR of bit TF2 and EXF2 in register T2CON. Neither
of these flags is cleared by hardware when the service routine is vectored to. In fact, the service
routine may need to determine whether it was TF2 or EXF2 which generated the interrupt, and the
bit will need to be cleared by software.
Special Function Register T2CON (Address C8H)
Reset Value: 00H
Bit
Function
TF2
Timer 2 Overflow Flag.
Must be cleared by software.
Set by a Timer 2 overflow. TF2 will not be set when either RCLK = 1 or TCLK = 1.
EXF2
Timer 2 External Flag.
Must be cleared by software.
Set when either a capture or reload is caused by a negative transition on T2EX and
EXEN2 = 1. When Timer 2 Interrupt is enabled, EXF2 = 1 will cause the CPU to vector
to the Timer 2 interrupt routine.
EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1, SFR T2MOD).
TF2
EXF2
RCLK
TCLK
C8H
T2CON
Bit No.
CF
H
MSB
LSB
EXEN2
TR2
C/T2
CP/RL2
CE
H
CD
H
CC
H
CB
H
CA
H
C9
H
C8
H
The shaded bits are not used for interrupt request control.