S1C6S3N2 TECHNICAL SOFTWARE
EPSON
II-85
CHAPTER 5: PERIPHERAL CIRCUITS (I/O Ports)
(2) Reading to I/O ports (P00–P03) when OSC3 running
When the CPU clock is OSC3, this routine sets I/O ports
(P00–P03) to input mode, and reads the input data to A
register.
Specifications
(3) Writing to I/O ports (P00–P03, P10–P13)
This routine outputs the value of A register to I/O ports
(P00–P03), then outputs the value of RAM, YDTB to P10–
P13.
Specifications
LD
X,7EH
;
AND
MX,1110B
;
LD
X,7DH
;
LD
B,9H
;
PINLP: LD
A,MX
;
ADD
B,0FH
;
JP
NZ,PINLP
;
Set ports P00–P03 to input mode
Read: Preparation
Loop: Load to A register
Repeat 10 times
This program example assumes that the pull-down resistor
uses the built-in pull-down resistor only, and performs the
read operation ten times.
Program
Note
Fig. 5.8.2
Correspondence between I/O
ports (output) and A register
and RAM
P01 register
P00 register
P02 register
P03 register
P11 register
P10 register
P12 register
P13 register
P00
P01
P02
P03
P10
P11
P12
P13
D0
D1
D2
D3
D0
D1
D2
D3
RAM, YDTB
A register
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: ......