Chapter 3 InterruptsIII - 14 Overview3-1-4 Interrupt Flag Setup(1) Disable all maskable interrupts.PSWbp6 : MIE = 0(2) Select the interrupt factor.(3) Enable the interrupt request flag tobe rewritten.MEMCTR (x'3F01')bp2 : IRWE = 1(4) Rewrite the interrupt request flag.xxxICRbp0 : xxxIR(5) Disable the interrupt request flag tobe rewritten.MEMCTR (x'3F01')bp2 : IRWE = 0(6) Set the interrupt level.xxxICRbp7-6 : xxxLV1-0PSWbp5-4 : IM1-0(7) Enable the interrupt.xxxICRbp1 : xxxIE = 1(8) Enable all maskable interrupts.PSWbp6 : MIE = 1Description(1) Clear the MIE flag of PSW to disable allmaskable interrupts. This is necessary,especially when the interrupt control register ischanged.(2) Select the interrupt factor such as interruptedge selection, or timer interrupt cycle change.(3) Set the IRWE flag of MEMCTR to enable theinterrupt request flag to be rewritten. This isnecessary only when the interrupt request flagis changed by the software.(4) Rewrite the interrupt request flag (xxxIR) of theinterrupt control register (xxxICR).(5) Clear the IRWE flag so that interrupt requestflag can not be rewritten by the software.(6) Set the interrupt level by the xxxLV1-0 flag ofthe interrupt control register (xxxICR).Set the IM1-0 flag of PSW when the interruptacceptance level of CPU should be changed.(7) Set the xxxIE flag of the interrupt controlregister (xxxICR) to enable the interrupt.(8) Set the MIE flag of PSW to enable maskableinterrupts.■ Interrupt request flag (IR) setup by the softwareThe interrupt request flag is operated by the hardware. That is set to "1" when any interrupt factor isgenerated, and cleared to "0" when the interrupt is accepted. If you want to operate it by the software, theIRWE flag of MEMCTR should be set to "1".■ Interrupt flag setup procedureA setup procedure of the interrupt request flag set by the hardware and the software shows as follows ;Setup Procedure