52
To avoid this problem, store a copy of the PDR6 data in a work area in memory. Perform the bit
manipulation on the data in the work area, then write this data to PDR6.
[A: Prior to executing BSET]
MOV. B #80, R0L
MOV. B R0L, @RAM0
MOV. B R0L, @PDR6
The PDR6 value (H'80) is written to a work area in
memory (RAM0) as well as to PDR6.
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
1
0
0
0
0
0
0
0
[B: BSET instruction executed]
BSET #0, @RAM0
The BSET instruction is executed designating the PDR6
work area (RAM0).
[C: After executing BSET]
MOV. B @RAM0, R0L
MOV. B R0L, @PDR6
The work area (RAM0) value is written to PDR6.
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
1
PDR6
1
0
0
0
0
0
0
1
RAM0
1
0
0
0
0
0
0
1