Example Of Program For I/O Ports - Epson S1C6S3N2 Technical Manual

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

Example of program
for I/O ports
(1) Reading to I/O ports (P00–P03, P10–P13), when OSC1 running
Specifications
Fig. 5.8.1
Correspondence of I/O ports
(input) and A register
S1C6S3N2 TECHNICAL SOFTWARE
P00–P03, P10–P13: I/O port data (07DH, 0FDH)
I/O port data can be read and output data can be set
through these ports.
• When writing data
When "1" is written:
When "0" is written:
Port data can be written also in input mode.
• When reading data out
When "1" is read out:
When "0" is read out:
The terminal voltage level of the I/O port is read out. When
the I/O port is in the input mode the voltage level being
input to the port terminal can be read out; in output mode
the output voltage level can be read.
Further, the built-in pull-down resistance goes ON during
read-out, so that the I/O port terminal is pulled down.
When the CPU clock is OSC1, this routine sets I/O ports
(P00–P03) to input mode, and reads the input data to A
register.
D3
P03
EPSON
CHAPTER 5: PERIPHERAL CIRCUITS (I/O Ports)
High level
Low level
High level
Low level
A register
D2
D1
P02
P01
D0
P00
II-83

Advertisement

Table of Contents
loading

Table of Contents