6-3
INTERRUPT SYSTEM
6.2
8XC251SA, SB, SP, SQ INTERRUPT SOURCES
Figure 6-1 illustrates the interrupt control system. The 8XC251Sx has eight interrupt sources;
seven maskable sources and the TRAP instruction (always enabled). The maskable sources in-
clude two external interrupts (INT0# and INT1#), three timer interrupts (timers 0, 1, and 2), one
programmable counter array (PCA) interrupt, and one serial port interrupt. Each interrupt (except
TRAP) has an interrupt request flag, which can be set by software as well as by hardware (see
Table 6-3, “Interrupt Control Matrix”). For some interrupts, hardware clears the request flag
when it grants an interrupt. Software can clear any request flag to cancel an impending interrupt.
6.2.1
External Interrupts
External interrupts INT0# and INT1# (INTx#) pins may each be programmed to be level-trig-
gered or edge-triggered, dependent upon bits IT0 and IT1 in the TCON register (see Figure 8-6
on page 8-8). If ITx = 0, INTx# is triggered by a detected low at the pin. If ITx = 1, INTx# is neg-
ative-edge triggered. External interrupts are enabled with bits EX0 and EX1 (EXx) in the IE0 reg-
ister (see Figure 6-2, “Interrupt Enable Register”). Events on the external interrupt pins set the
interrupt request flags IEx in TCON. These request bits are cleared by hardware vectors to service
routines only if the interrupt is negative-edge triggered. If the interrupt is level-triggered, the in-
terrupt service routine must clear the request bit. External hardware must deassert INTx# before
the service routine completes, or an additional interrupt is requested. External interrupt pins must
be deasserted for at least four state times prior to a request.
External interrupt pins are sampled once every four state times (a frame length of 666.4 ns at 12
MHz). A level-triggered interrupt pin held low or high for any five-state time period guarantees
detection. Edge-triggered external interrupts must hold the request pin low for at least five state
times. This ensures edge recognition and sets interrupt request bit EXx. The CPU clears EXx au-
tomatically during service routine fetch cycles for edge-triggered interrupts.
Table 6-2. Interrupt System Special Function Registers
Mnemonic
Description
Address
IE0
Interrupt Enable Register. Used to enable and disable programmable
interrupts. The reset value of this register is zero (interrupts disabled).
S:A8H
IPL0
Interrupt Priority Low Register. Establishes relative four-level priority for
programmable interrupts. Used in conjunction with IPH0.
S:B8H
IPH0
Interrupt Priority High Register. Establishes relative four-level priority for
programmable interrupts. Used in conjunction with IPL0.
S:B7H
NOTE:
Other special function registers are described in their respective chapters.
Summary of Contents for 8XC251SA
Page 2: ......
Page 3: ...May 1996 8XC251SA 8XC251SB 8XC251SP 8XC251SQ Embedded Microcontroller User s Manual...
Page 18: ......
Page 19: ...1 Guide to This Manual...
Page 20: ......
Page 30: ......
Page 31: ...2 Architectural Overview...
Page 32: ......
Page 41: ...3 Address Spaces...
Page 42: ......
Page 63: ...4 Device Configuration...
Page 64: ......
Page 81: ...5 Programming...
Page 82: ......
Page 102: ......
Page 103: ...6 Interrupt System...
Page 104: ......
Page 120: ......
Page 121: ...7 Input Output Ports...
Page 122: ......
Page 132: ......
Page 133: ...8 Timer Counters and Watchdog Timer...
Page 134: ......
Page 153: ...9 Programmable Counter Array...
Page 154: ......
Page 170: ......
Page 171: ...10 Serial I O Port...
Page 172: ......
Page 187: ...11 Minimum Hardware Setup...
Page 188: ......
Page 197: ...12 Special Operating Modes...
Page 198: ......
Page 206: ......
Page 207: ...13 External Memory Interface...
Page 208: ......
Page 239: ...14 Programming and Verifying Nonvolatile Memory...
Page 240: ......
Page 250: ......
Page 251: ...A Instruction Set Reference...
Page 252: ......
Page 390: ......
Page 391: ...B Signal Descriptions...
Page 392: ......
Page 400: ......
Page 401: ...C Registers...
Page 402: ......
Page 436: ......
Page 437: ...Glossary...
Page 438: ......
Page 446: ......
Page 447: ...Index...
Page 448: ......
Page 458: ......