54
To avoid this problem, store a copy of the PCR6 data in a work area in memory. Perform the bit
manipulation on the data in the work area, then write this data to PCR6.
[A: Prior to executing BCLR]
MOV. B
#3F
, R0L
MOV. B R0L, @RAM0
MOV. B R0L, @PCR6
The PCR6 value (H'3F) is written to a work area in
memory (RAM0) as well as to PCR6.
P6
7
P6
6
P6
5
P6
4
P6
3
P6
2
P6
1
P6
0
Input/output
Input
Input
Output
Output
Output
Output
Output
Output
Pin state
Low
level
High
level
Low
level
Low
level
Low
level
Low
level
Low
level
Low
level
PCR6
0
0
1
1
1
1
1
1
PDR6
1
0
0
0
0
0
0
0
RAM0
0
0
1
1
1
1
1
1
[B: BCLR instruction executed]
BCLR #0, @RAM0
The BCLR instruction is executed designating the PCR6
work area (RAM0).
[C: After executing BCLR]
MOV. B @RAM0, R0L
MOV. B R0L, @PCR6
The work area (RAM0) value is written to PCR6.
P6
7
P6
6
P6
5
P6
4
P6
3
P6
2
P6
1
P6
0
Input/output
Input
Input
Output
Output
Output
Output
Output
Output
Pin state
Low
level
High
level
Low
level
Low
level
Low
level
Low
level
Low
level
High
level
PCR6
0
0
1
1
1
1
1
0
PDR6
1
0
0
0
0
0
0
0
RAM0
0
0
1
1
1
1
1
0