18
EPSON
S1C6N3B0 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIARCUITS AND OPERATION (Input Ports)
4.3.4 Control of input ports
Table 4.3.4.1 shows the input port control bits and their addresses.
Table 4.3.4.1 I/O memory (Input port)
Address
Comment
D3
D2
Register
D1
D0
Name
Init 1
10
0E0H
K03
K02
K01
K00
R
K03
K02
K01
K00
– 2
High
Low
K0 input port data
0E8H
EIK03
EIK02
EIK01
EIK00
R/W
EIK03
EIK02
EIK01
EIK00
0
Enable
Mask
Interrupt mask register (K03)
Interrupt mask register (K02)
Interrupt mask register (K01)
Interrupt mask register (K00)
0EDH
00
IP0
IK0
R
0 3
IP0 4
IK0 4
– 2
0
–
Yes
–
No
Unused
Interrupt factor flag (P0)
Interrupt factor flag (K00–K03)
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 (0E0H)
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 bits are reading, so writing cannot be done.
EIK00–EIK03: Interrupt mask registers (0E8H)
Masking the interrupt of the input port terminals can be done with these registers.
When "1" is written: Enabled
When "0" is written: Masked
Reading: Valid
With these registers, masking of the input port bits can be done for each of the four bits.
At initial reset, these registers are all set to "0".
IK0: Interrupt factor flag (0EDH D0)
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
IK0 is the interrupt factor flag corresponding to the input ports K00–K03 and is set to "1" at the falling
edge of the input signal. From the status of this flag, the software can decide whether an input interrupt
has occurred or not.
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. Be very careful when interrupt factor flags are in the same address.
At initial reset, this flag is set to "0".