Renesas H8/36912 Series User Manual page 71

16-bit single-chip microcomputer
Hide thumbs Also See for H8/36912 Series:
Table of Contents

Advertisement

[Prior to executing BCLR]
Input/output
Pin state
PCR5
PDR5
[BCLR instruction executed]
BCLR
#0,
[After executing BCLR]
Input/output
Pin state
PCR5
PDR5
[Description on operation]
1. 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.
2. Next, the CPU clears bit 0 in the read data to 0, changing the data to H'FE.
3. Finally, H'FE is written to PCR5 and BCLR instruction execution ends.
As a result of this operation, bit 0 in PCR5 becomes 0, making P50 an input port. However, bits 7
and 6 in PCR5 change to 1, so that P57 and P56 change from input pins to output pins. To prevent
this problem, store a copy of the PCR5 data in a work area in memory and manipulate data of the
bit in the work area, then write this data to PCR5.
Downloaded from
Elcodis.com
electronic components distributor
P57
P56
P55
Input
Input
Output
Low
High
Low
level
level
level
0
0
1
1
0
0
The BCLR instruction is executed for PCR5.
@PCR5
P57
P56
P55
Output
Output
Output
Low
High
Low
level
level
level
1
1
1
1
0
0
P54
P53
P52
Output
Output
Output
Low
Low
Low
level
level
level
1
1
1
0
0
0
P54
P53
P52
Output
Output
Output
Low
Low
Low
level
level
level
1
1
1
0
0
0
Rev. 1.00, 11/03, page 43 of 376
P51
P50
Output
Output
Low
Low
level
level
1
1
0
0
P51
P50
Output
Input
Low
High
level
level
1
0
0
0

Advertisement

Table of Contents
loading

Table of Contents