
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Input Ports)
14
EPSON
S1C60N09 TECHNICAL MANUAL
4.3.4 I/O memory of input port
Table 4.3.4.1 list the input port control bits and their addresses.
Table 4.3.4.1 Input port control bits
Address
Comment
D3
D2
Register
D1
D0
Name
Init 1
10
073H
K03
K02
K01
K00
R
K03
K02
K01
K00
– 2
High
Low
Input port data (K00–K03)
075H
EIK03
EIK02
EIK01
EIK00
R/W
EIK03
EIK02
EIK01
EIK00
0
Enable
Mask
Interrupt mask register (K00–K03)
07AH
0
IK0
SWIT1
SWIT0
R
0 3
IK0 4
SWIT1 4
SWIT0 4
– 2
0
–
Yes
–
No
Unused
Interrupt factor flag (K00–K03)
Interrupt factor flag (stopwatch 1 Hz)
Interrupt factor flag (stopwatch 10 Hz)
1
2
Initial value at initial reset
Not set in the circuit
3
4
Always "0" being read
Reset (0) immediately after being read
K00–K03: Input port data (073H)
The input data of the input port terminals can be read with these registers.
When "1" is read: High level
When "0" is read: Low level
Writing: Invalid
The value read is "1" when the terminal voltage of the input port (K00–K03) goes high (VDD), and "0"
when the voltage goes low (VSS). These are read only bits, so writing cannot be done.
EIK00–EIK03: Interrupt mask registers (075H)
Masking the interrupt of the input port terminals can be done with these registers.
When "1" is written: Enable
When "0" is written: Mask
Reading: Valid
With these registers, masking of the input port bits can be done for each of the four bits.
After an initial reset, these registers are all set to "0".
IK0: Interrupt factor flag (07AHD2)
This flag indicates the occurrence of an input interrupt.
When "1" is read: Interrupt has occurred
When "0" is read: Interrupt has not occurred
Writing: Invalid
The interrupt factor flag IK0 is associated with K00–K03. From the status of this flag, the software can
decide whether an input interrupt has occurred.
This flag is reset when the software has read it.
Reading of interrupt factor flag is available at EI, but be careful in the following cases.
If the interrupt mask register value corresponding to the interrupt factor flag to be read is set to "1", an
interrupt request will be generated by the interrupt factor flag set timing, or an interrupt request will not
be generated.
After an initial reset, this flag is set to "0".
4.3.5 Programming note
When modifying the input port from high level to low level with pull-down resistor, a delay will occur at
the fall of the waveform due to time constant of the pull-down resistor and input gate capacities. Provide
appropriate waiting time in the program when performing input port reading.