II-84
EPSON
S1C6S3N2 TECHNICAL SOFTWARE
CHAPTER 5: PERIPHERAL CIRCUITS (I/O Ports)
Next it sets P10–P13 to input mode, and reads the input
data to RAM, YINB.
Finally it sets P00–P03 to output mode, and reads the status
of pins P00–P03 into RAM, YDTB.
Data Bits
D3
D2
D1
D0
●
●
H
P13
P12
P11
P10
● ★
● ★
H
P03
P02
P01
P00
Address
Table 5.8.2
Correspondence of I/O ports
and RAM store data
YINB
EQU
●
●
H
;
YDTB
EQU
● ★
● ★
H
;
;
;
LD
X,7EH
;
AND
MX,1110B
;
LD
X,7DH
;
LD
A,MX
;
;
LD
X,0FEH
;
AND
MX,1110B
;
LD
X,0FDH
;
LD
Y,YINB
;
LD
MY,MX
;
;
LD
X,7EH
;
OR
MX,0001B
;
LD
X,7DH
;
LD
Y,YDTB
;
LD
MY,MX
;
Data buffer address to read
Data buffer address
Set ports P00–P03 to input mode
Load the input to P00–P03 into A register
Set ports P10–P13 to input mode
Store the input to P10–P13 into RAM, YINB
Set ports P00–P03 to output mode
Store the pin data of P00–P03 to RAM, YDTB
Program
When the I/O port is set to output mode and a low-imped-
ance load is connected to the port pins, the value of data
written to the register and data read out may differ.
Note
Summary of Contents for S1C6S3N2
Page 4: ......
Page 6: ......
Page 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Page 8: ......
Page 141: ...Software Software S1C6S3N2 II Technical Software ...
Page 142: ......
Page 146: ......