S1C88650 TECHNICAL MANUAL EPSON 55
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (I/O Ports)
Readout in input mode consists simply of a direct
readout of the input terminal state: the data being
"1" when the input terminal is at HIGH (VDD) level
and "0" when it is at LOW (VSS) level.
When the built-in pull-up resistor is enabled with
the software, the port terminal will be pulled-up to
high during input mode.
Even in input mode, data can be written to the data
registers without affecting the terminal state.
To set an I/O port to output mode, write "1" to the
I/O control register. An I/O port which is set to
output mode functions as an output port.
When port output data is "1", a HIGH (VDD) level is
output and when it is "0", a LOW (VSS) level is
output. Readout in output mode consists of the
contents of the data register.
At initial reset, I/O control registers are set to "0"
(I/O ports are set to input mode).
5.7.4 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 PULPxx that
corresponds to each port, and the Pxx terminal is
pulled up during the input mode. 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. When the port is set
in the output mode, the setting of the pull-up
control register becomes invalid (no pull-up is done
during output).
At initial reset, the pull-up control registers are set
to "1" (pulled up).
When changing the port 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
I/O port. Make this wait time the amount of time
or more calculated by the following expression.
Wait time = RIN x (CIN + load capacitance on the
board) x 1.6 [sec]
RIN: Pull up resistance Max. value
CIN: Terminal capacitance Max. value
For unused ports, select "With resistor" and enable
pull-up using the pull-up control registers.
5.7.5 Special output
Besides general purpose DC input/output, I/O
ports P14–P17 can also be assigned special output
functions in software as shown in Table 5.7.5.1.
Table 5.7.5.1 Special output ports
Output port
P14
P15
P16
P17
Special output
TOUT0/TOUT1 output
TOUT2/TOUT3 output
FOUT output
TOUT2/TOUT3 output
When using P14–P17 as a special output port, write
"1" to the corresponding I/O control register
(IOC14–IOC17) to set the port to the output mode.
■ TOUT output (P14, P15)
In order for the S1C88650 to provide clock signal to
an external device, the terminals P14 and P15 can
be used to output a TOUTx signal (clock output by
the programmable timer).
The output control for the TOUTx signals (x = 0–3)
is done by the registers PTOUTx. When PTOUTx is
set to "1", the TOUTx signal is output from the
corresponding port terminal, when "0" is set, the
port is set for DC output. When PTOUTx is "1",
settings of the I/O control register IOC14/IOC15
and data register P14D/P15D become invalid.
The TOUT0–TOUT3 signals are generated from the
underflow and compare-match signals of the
programmable timers 0–3.
With respect to frequency control, see "5.10 Pro-
grammable Timer".
Since the TOUTx signals are generated asynchro-
nously from the registers PTOUTx, when the
signals are turned ON or OFF by the register
settings, a hazard of a 1/2 cycle or less is generated.
Figure 5.7.5.1 shows the output waveform of the
TOUT signal.
PTOUTx
TOUTx output
(P14/15)
01
Fig. 5.7.5.1 Output waveform of TOUT signal
Note: If PTOUT0 and PTOUT1 are set to "1" at the
same time, PTOUT1 is effective. Similarly, if
PTOUT2 and PTOUT3 are set to "1",
PTOUT3 is effective.