English
Language : 

HD6473847RHV Datasheet, PDF (101/546 Pages) Renesas Technology Corp – Renesas 8-Bit Single-Chip Microcomputer H8 Family / H8/300L Super Low Power Series
BCLR instruction executed
BCLR #1, @PCR3
Section 2 CPU
The BCLR instruction is executed for PCR3.
After executing BCLR
P37
P36
P35
P34
P33
P32
P31
⎯
Input/output Output Output Output Output Output Output Input ⎯
Pin state
Low
High Low
Low
Low
Low
High ⎯
level level level level level level level
PCR3
1
1
1
1
1
1
0
1
PDR3
1
0
0
0
0
0
0
1
Description on operation
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 1 in the read data to 0, changing the data to H'FD.
Finally, H'FD is written to PCR3 and BCLR instruction execution ends.
As a result of this operation, bit 1 in PCR3 becomes 0, making P31 an input port. However, bits 7
and 6 in PCR3 change to 1, so that P37 and P36 change from input pins to output pins. To prevent
this problem, store a copy of the PCR3 data in a work area in memory and manipulate data of the
bit in the work area, then write this data to PCR3.
Prior to executing BCLR
MOV.B
MOV.B
MOV.B
#3F, R0L
R0L, @RAM0
R0L, @PCR3
The PCR3 value (H'3F) is written to a work area in
memory (RAM0) as well as to PCR3.
Rev. 7.00 Mar. 08, 2010 Page 69 of 510
REJ09B0024-0700