English
Language : 

HD64F3664FPV Datasheet, PDF (78/446 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
Section 2 CPU
(2) Bit Manipulation in a Register Containing a Write-Only Bit
Example 3: BCLR instruction executed designating port 5 control register PCR5
P57 and P56 are input pins, with a low-level signal input at P57 and a high-level signal input at
P56. P55 to P50 are output pins that output low-level signals. An example of setting the P50 pin as
an input pin by the BCLR instruction is shown below. It is assumed that a high-level signal will be
input to this input pin.
Prior to executing BCLR
Input/output
Pin state
PCR5
PDR5
P57
Input
Low
level
0
1
P56
Input
High
level
0
0
P55
Output
Low
level
1
0
P54
Output
Low
level
1
0
P53
Output
Low
level
1
0
P52
Output
Low
level
1
0
P51
Output
Low
level
1
0
P50
Output
Low
level
1
0
BCLR instruction executed
BCLR #0, @PCR5
The BCLR instruction is executed for PCR5.
After executing BCLR
Input/output
Pin state
PCR5
PDR5
P57
Output
Low
level
1
1
P56
Output
High
level
1
0
P55
Output
Low
level
1
0
P54
Output
Low
level
1
0
P53
Output
Low
level
1
0
P52
Output
Low
level
1
0
P51
Output
Low
level
1
0
P50
Input
High
level
0
0
Description on operation
When the BCLR instruction is executed, first the CPU reads PCR5. Since PCR5 is a write-only
register, the CPU reads a value of H'FF, even though the PCR5 value is actually H'3F.
Next, the CPU clears bit 0 in the read data to 0, changing the data to H'FE.
Finally, H'FE is written to PCR5 and BCLR instruction execution ends.
Rev. 6.00 Mar. 24, 2006 Page 48 of 412
REJ09B0142-0600