![](http://datasheet.mmic.net.cn/30000/MC68HC16S2CPU25_datasheet_2369780/MC68HC16S2CPU25_43.png)
MC68HC16S2
MOTOROLA
MC68HC16S2TS/D
43
Arbitration is performed by means of serial contention between values stored in individual module inter-
rupt arbitration (IARB) fields. Each module that can request interrupt service, including the SIM, has an
IARB field in its configuration register. IARB fields can be assigned values from %0000 to %1111. In
order to implement an arbitration scheme, each module that can request interrupt service must be
assigned a unique, non-zero IARB field value during system initialization. Arbitration priorities range
from %0001 (lowest) to %1111 (highest) — if the CPU recognizes an interrupt service request from a
source that has an IARB field value of %0000, a spurious interrupt exception is processed.
WARNING
Do not assign the same arbitration priority to more than one module. When two or
more IARB fields have the same non-zero value, the CPU16 interprets multiple
vector numbers at the same time, with unpredictable consequences.
Because the EBI manages external interrupt requests, the SIM IARB value is used for arbitration be-
tween internal and external interrupt requests. The reset value of IARB for the SIM is %1111, and the
reset IARB value for all other modules is %0000.
Although arbitration is intended to deal with simultaneous requests of the same priority, it always takes
place, even when a single source is requesting service. This is important for two reasons: the EBI does
not transfer the interrupt acknowledge read cycle to the external bus unless the SIM wins contention,
and failure to contend causes the interrupt acknowledge bus cycle to be terminated early, by a bus error.
When arbitration is complete, the module with the highest arbitration priority must terminate the bus
cycle. Internal modules place an interrupt vector number on the data bus and generate appropriate in-
ternal cycle termination signals. In the case of an external interrupt request, after the interrupt acknowl-
edge cycle is transferred to the external bus, the appropriate external device must decode the mask
value and respond with a vector number, then generate data and size acknowledge (DSACK) termina-
tion signals, or it must assert the autovector (AVEC) request signal. If the device does not respond in
time, the EBI bus monitor asserts the bus error signal (BERR), and a spurious interrupt exception is
taken.
Chip-select logic can also be used to generate internal AVEC or DSACK signals in response to interrupt
requests from external devices. Chip-select address match logic functions only after the EBI transfers
an interrupt acknowledge cycle to the external bus following IARB contention. If a module makes an
interrupt request of a certain priority, and the appropriate chip-select registers are programmed to gen-
erate AVEC or DSACK signals in response to an interrupt acknowledge cycle for that priority level, chip-
select logic does not respond to the interrupt acknowledge cycle, and the internal module supplies a
vector number and generates internal cycle termination signals.
For periodic timer interrupts, the PIRQL field in the periodic interrupt control register (PICR) determines
PIT priority level. A PIRQL value of %000 means that PIT interrupts are inactive. By hardware conven-
tion, when the CPU16 receives simultaneous interrupt requests of the same level from more than one
SIM source (including external devices), the periodic interrupt timer is given the highest priority, followed
3.9.2 Interrupt Processing Summary
A summary of the interrupt processing sequence follows. When the sequence begins, a valid interrupt
service request has been detected and is pending.
A. The CPU finishes higher priority exception processing or reaches an instruction boundary.
B. The processor state is stacked, then the CCR PK extension field is cleared.
C. The interrupt acknowledge cycle begins: