![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_441.png)
14.5
14.5.1 External interrupt function
Operation of the DTP/External Interrupt Circuit
MB90560 series
CHAPTER 14 DTP/EXTERNAL INTERRUPT CIRCUIT
417
The DTP/external interrupt circuit has an external interrupt function that generates an
interrupt request when a selected signal level is input to a DTP/external interrupt pin.
I
External interrupt function
If the edge or level selected for a DTP/external interrupt pin by the request level setting register
(ELVR) is detected at that pin, the corresponding external interrupt flag bit of the DTP/interrupt
cause register (EIRR:ER7 to ER0) is set to “1”. If, in this state, the corresponding interrupt
request enable bit of the DTP/interrupt enable register is set to “1” to enable interrupts (ENIR:
EN7 to EN0 = 1), the interrupt cause is reported to the interrupt controller. The interrupt
controller checks the value of the interrupt level (ICR: IL2 to IL0) in relation to those of the
interrupt requests from other peripheral functions, the interrupt priority, etc. The CPU checks the
value of the interrupt level mask register (PS: ILM2 to ILM0) and the interrupt level, the interrupt
enable bit (PS: CCR: 1), etc. When the interrupt request is accepted by the CPU, the CPU
executes an internal interrupt processing routine (microprogram) and branches to the interrupt
processing routine. In the interrupt processing routine, 0 must be written to the corresponding
interrupt request flag bit to clear the interrupt request.
<Check>
An ER bit is set to “1” if a DTP/external interrupt cause is generated, regardless of the
state of the corresponding EN bit.
When the interrupt routine is activated, the ER bit that caused the routine to be activated
must be cleared. If the ER bit is kept at “1”, control cannot return from the interrupt. Only
clear the flag bit that caused the interrupt; do not clear the other bits without reason.