AT89C51RB2/RC2
Interrupt System
The AT89C51RB2/RC2 has a total of 9 interrupt vectors: two external interrupts (INT0
and INT1), three timer interrupts (timers 0, 1 and 2), the serial port interrupt, SPI inter-
rupt, Keyboard interrupt and the PCA global interrupt. These interrupts are shown in
Figure 22.
Figure 22. Interrupt Control System
High Priority
IPH, IPL
Interrupt
3
INT0
IE0
0
3
0
TF0
Interrupt
3
INT1
IE1
Polling
0
3
Sequence, Decreasing From
High to Low Priority
TF1
0
3
PCA IT
0
3
0
RI
TI
3
TF2
EXF2
0
3
KBD IT
SPI IT
0
3
0
Individual Enable
Low Priority
Interrupt
Global Disable
Each of the interrupt sources can be individually enabled or disabled by setting or clear-
ing a bit in the Interrupt Enable register (Table 45 and Table 47). This register also
contains a global disable bit, which must be cleared to disable all interrupts at once.
Each interrupt source can also be individually programmed to one out of four priority lev-
els by setting or clearing a bit in the Interrupt Priority register (Table 48) and in the
Interrupt Priority High register (Table 46 and Table 47) shows the bit values and priority
levels associated with each combination.
55
4180C–8051–12/03