Renesas H8/3847R Series Hardware Manual page 127

8-bit single-chip microcomputer super low power
Table of Contents

Advertisement

[B: BCLR instruction executed]
BSET
#0
,
[C: After executing BCLR]
P3
7
Input/output
Output
Pin state
Low
level
PCR3
1
PDR3
1
[D: Explanation of how BCLR operates]
When the BCLR instruction is executed, first the CPU reads PCR3. Since PCR3 is a write-only
register, the CPU reads a value of H'FF, even though the PCR3 value is actually H'3F.
Next, the CPU clears bit 0 in the read data to 0, changing the data to H'FE. Finally, this value
(H'FE) is written to PCR3 and BCLR instruction execution ends.
As a result of this operation, bit 0 in PCR3 becomes 0, making P3
and 6 in PCR3 change to 1, so that P3
To avoid this problem, store a copy of the PCR3 data in a work area in memory. Perform the bit
manipulation on the data in the work area, then write this data to PCR3.
[A: Prior to executing BCLR]
MOV. B
#H'3F
,
MOV. B
R0L
,
MOV. B
R0L
,
P3
7
Input/output
Input
Pin state
Low
level
PCR3
0
PDR3
1
RAM0
0
The BCLR instruction is executed designating PCR3.
@PCR3
P3
P3
6
5
Output
Output
High
Low
level
level
1
1
0
0
and P3
7
The PCR3 value (H'3F) is written to a work area in
R0L
memory (RAM0) as well as to PCR3.
@RAM0
@PCR3
P3
P3
6
5
Input
Output
High
Low
level
level
0
1
0
0
0
1
P3
P3
4
3
Output
Output
Low
Low
level
level
1
1
0
0
an input port. However, bits 7
0
change from input pins to output pins.
6
P3
P3
4
3
Output
Output
Low
Low
level
level
1
1
0
0
1
1
Rev. 6.00 Aug 04, 2006 page 89 of 680
Section 2 CPU
P3
P3
P3
2
1
Output
Output
Input
Low
Low
High
level
level
level
1
1
0
0
0
0
P3
P3
P3
2
1
Output
Output
Output
Low
Low
Low
level
level
level
1
1
1
0
0
0
1
1
1
REJ09B0145-0600
0
0

Advertisement

Table of Contents
loading

Table of Contents