Coding Examples:
To select the rising edge of the NMI input:
To select the falling edge of the NMI input:
BSET.B #4, @H'FFFC
BCLR.B #4, @H'FFFC
IRQ
0
(Interrupt Request 0):
An IRQ
0
interrupt can be requested by a Low input to the IRQ
0
pin
and/or a watchdog timer overflow. A Low IRQ
0
input requests an IRQ
0
interrupt if the interrupt
request enable 0 bit (IRQ
0
E) in the P1CR is set to “1.” IRQ
0
must be held Low until the CPU
accepts the interrupt. Otherwise the request will be ignored. A watchdog timer overflow requests
an IRQ
0
interrupt if the TME bit is set to “1” and the WT/IT bit is cleared to “0” in the watchdog
timer's control/status register. See section 13, “Watchdog Timer” for details of the watchdog
timer.
The IRQ
0
interrupt can be assigned any priority level from 7 to 0 by setting the corresponding
value in the upper four bits of IPRA. If bit 4 of data transfer enable register A (DTEA) is set to
“1,” an IRQ
0
interrupt starts the data transfer controller. Otherwise the interrupt is served by the
CPU.
In the CPU interrupt-handling sequence for IRQ
0
, the T bit of the status register is cleared to “0,”
and the interrupt mask level is set to the value in the upper four bits of IPRA.
Coding Examples:
To enable IRQ
0
to be requested by IRQ
0
input:
To assign priority level 7 to IRQ
0
:
To have IRQ
0
start the DTC:
BSET.B #5, @H'FFFC
OR.B #70, @H'FFF0
BSET.B #4, @H'FFF4
IRQ
1
(Interrupt Request 1):
An IRQ
0
interrupt is requested by a High-to-Low transition at the
IRQ
1
pin. The IRQ
1
interrupt is enabled only when the interrupt request enable 1 bit (IRQ
1
E) in
the P1CR is set to “1.”
The IRQ
1
interrupt can be assigned any priority level from 7 (high) to 0 (low) by setting the
corresponding value in the lower four bits of IPRA. If bit 0 of data transfer enable register A
(DTEA) is set to “1,” an IRQ
1
interrupt starts the data transfer controller. Otherwise the interrupt
is served by the CPU.
The interrupt controller holds the IRQ
1
request until the IRQ
1
exception-handling sequence
begins, then clears the IRQ
1
request. If another interrupt is requested at the IRQ
1
pin during the
IRQ
1
interrupt-handling routine, the request is held, but the IRQ
1
exception-handling sequence is
not carried out immediately because the interrupt is masked by bits I2 to I0 in the status register.
On return from the interrupt-handling routine one more instruction is executed, then the
exception-handling sequence for the second IRQ
1
interrupt is carried out.
100