Hitachi H8/3062 Hardware Manual page 100

Single-chip microcomputer h8/3062 series; h8/3062b series; h8/3062f-ztat series; h8/3064f-ztat series
Hide thumbs Also See for H8/3062:
Table of Contents

Advertisement

Before Execution of BCLR Instruction
P4
7
Input/output
Input
DDR
0
Execution of BCLR Instruction
BCLR
#0, P4DDR
After Execution of BCLR Instruction
P4
7
Input/output
Output
DDR
1
Explanation: To execute the BCLR instruction, the CPU begins by reading P4DDR. Since
P4DDR is a write-only register, it is read as H'FF, even though its true value is H'3F.
Next the CPU clears bit 0 of the read data, changing the value to H'FE.
Finally, the CPU writes this value (H'FE) back to P4DDR to complete the BCLR instruction.
As a result, P4
DDR is cleared to 0, making P4
0
are set to 1, making P4
The BCLR instruction can be used to clear flags in the on-chip registers to 0. In the case of the
IRQ status register (ISR), for example, a flag must be read as a condition for clearing it, but when
using the BCLR instruction, if it is known that a flag has been set to 1 in an interrupt-handling
routine, for instance, it is not necessary to read the flag ahead of time.
52
P4
P4
6
5
Input
Output
0
1
;
Execute BCLR instruction on DDR
P4
P4
6
5
Output
Output
1
1
and P4
output pins.
7
6
P4
P4
P4
4
3
Output
Output
Output
1
1
1
P4
P4
P4
4
3
Output
Output
Output
1
1
1
an input pin. In addition, P4
0
P4
P4
2
1
0
Output
Output
1
1
P4
P4
2
1
0
Output
Input
1
0
DDR and P4
7
6
DDR

Advertisement

Table of Contents
loading

Table of Contents