![Epson S1C88650 Скачать руководство пользователя страница 53](http://html.mh-extra.com/html/epson/s1c88650/s1c88650_technical-manual_106918053.webp)
S1C88650 TECHNICAL MANUAL
EPSON
45
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Input Ports)
5.5.3 Pull-up control
When "With resistor" is selected by mask option,
the software can enable and disable the pull-up
resistor for each port (1-bit units).
The pull-up resistor becomes effective by writing
"1" to the pull-up control register PULK0x that
corresponds to each port, and the input line is
pulled up. When "0" has been written, no pull-up is
done.
When "Gate direct" is selected by mask option, the
corresponding pull-up control register is
disconnected from the input line, so it can be used
as a general-purpose register.
At initial reset, the pull-up control register is set to
"1" (pulled up).
The input port with a pull-up resistor suits input
from the push switch and key matrix.
When changing the input terminal from LOW level
to HIGH with the built-in pull-up resistor, a delay
in the waveform rise time will occur depending on
the time constant of the pull-up resistor and the
load capacitance of the terminal. It is necessary to
set an appropriate wait time for introduction of an
input port. In particular, special attention should be
paid to key scan for key matrix formation. Make
this wait time the amount of time or more calcu-
lated by the following expression.
Wait time = R
IN
x (C
IN
+ load capacitance on the
board) x 1.6 [sec]
R
IN
: Pull up resistance Max. value
C
IN
: Terminal capacitance Max. value
The input port without a pull-up resistor is suits for
slide switch input and interfacing with other LSIs.
In this case, take care that a floating state does not
occur in input.
For unused ports, select "With resistor" and enable
pull-up using the pull-up control registers.
5.5.4 Interrupt function and input
comparison register
All the input ports (K00–K07) provide the interrupt
functions. The conditions for issuing an interrupt
can be set by the software.
When the interrupt generation condition set for a
terminal is met, the interrupt factor flag FK00–FK07
corresponding to the terminal is set at "1" and an
interrupt is generated.
Interrupt can be prohibited by setting the interrupt
enable registers EK00–EK07 for the corresponding
interrupt factor flags.
Furthermore, the priority level for input interrupt
can be set at the desired level (0–3) using the
interrupt priority registers PK00–PK01.
For details on the interrupt control registers for the
above and on operations subsequent to interrupt
generation, see "5.14 Interrupt and Standby Status".
The exception processing vectors for each interrupt
factor are set as follows:
K07 input interrupt: 000006H
K06 input interrupt: 000008H
K05 input interrupt: 00000AH
K04 input interrupt: 00000CH
K03 input interrupt: 00000EH
K02 input interrupt: 000010H
K01 input interrupt: 000012H
K00 input interrupt: 000014H
Figure 5.5.4.1 shows the configuration of the input
interrupt circuit.
The input comparison register KCP selects whether
the interrupt for each input port will be generated
on the rising edge or the falling edge of input.
When the K0x input signal changes to the status set
by the input comparison register KCP0x, the
interrupt factor flag FK0x is set to "1" and an
interrupt occurs.
The input port has a chattering-eliminate circuit
that checks input level to avoid unnecessary
interrupt generation due to chattering. There are
two separate chattering-eliminate circuits for K00–
K03 and K04–K07 and they can be set up
individually. The CTK00x–CTK02x registers allow
selection of signal level check time as shown in
Table 5.5.4.1.