Renesas F-ZTAT H8 Series Hardware Manual page 118

8-bit single-chip microcomputer
Hide thumbs Also See for F-ZTAT H8 Series:
Table of Contents

Advertisement

3. Exception Handling
Figure 3.7 shows the procedure for setting a bit in a port mode register and clearing the interrupt
request flag.
When switching a pin function, mask the interrupt before setting the bit in the port mode register.
After accessing the port mode register, execute at least one instruction (e.g., NOP), then clear the
interrupt request flag from 1 to 0. If the instruction to clear the flag is executed immediately after
the port mode register access without executing an intervening instruction, the flag will not be
cleared.
An alternative method is to avoid the setting of interrupt request flags when pin functions are
switched by keeping the pins at the high level so that the conditions in table 3.5 do not occur.
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
Rev.3.00 Jul. 19, 2007 page 92 of 532
REJ09B0397-0300
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

Advertisement

Table of Contents
loading

Table of Contents