Notes On Interrupt Request Flag Clearing Methods - Hitachi H8/3937 Series Hardware Manual

Table of Contents

Advertisement

CCR I bit
Set port mode register bit
Execute NOP instruction
Clear interrupt request flag to 0
CCR I bit
Figure 3-7 Port Mode Register Setting and Interrupt Request Flag Clearing Procedure
3.4.3

Notes on Interrupt Request Flag Clearing Methods

Either of the following methods should be used for flag clearing in the interrupt request registers
(IRR1, IRR2, IWPR).
Method 1
Clear the interrupt request flag with a BCLR instruction. (Recommended method)
Sample coding for clearing IRRI1 (bit 1 of IRR1):
BCLR #1,@IRR1:8
Method 2
Write data to the interrupt request register with 0 for the relevant interrupt request flag and 1s for
the other flags. (Faster execution than Method 1)
Sample coding for clearing IRRI1 (bit 1 of IRR1):
MOV.B #B'11111101,R1L
MOV.B R1L,@IRR1:8
1
0
Interrupts masked. (Another possibility
is to disable the relevant interrupt in
interrupt enable register 1.)
After setting the port mode register bit,
first execute at least one instruction
(e.g., NOP), then clear the interrupt
request flag to 0
Interrupt mask cleared
83

Advertisement

Table of Contents
loading

Table of Contents