EasyManua.ls Logo

Epson S1C17624 - 9.3 Data Input;Output

Epson S1C17624
368 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
9 I/O PORTS (P)
S1C17624/604/622/602/621 TECHNICAL MANUAL
Seiko Epson Corporation
9-3
*2: Available only for S1C17624, *3: Available only for S1C17624/604, *4: Available only for S1C17624/622
*5: P43 can only be used as an output port. For how to configure P43, see the P43MUX/P40_43PMUX register description.
At initial reset, each I/O port pin (Pxy) is initialized for the default function (“Pin function 1” in Table 9.2.1).
For information on functions other than the I/O ports, see t
he descriptions of the peripheral modules indicated in
parentheses. The sections below describe port functions with the pins set as general-purpose I/O ports.
Data Input/Output9.3
Data input/output control
The I/O ports allow selection of the data input/output direction for each bit using PxOENy/Px_OEN register and
PxIENy/Px_IEN register. PxOENy enables and disables data output, while PxIENy enabl
es and disables data
input.
3.1 Data Input/Output StatusTable 9.
PxOENy
output control
PxIENy
input control
PxPUy
pull-up control
Port status
0 1 0 Functions as an input port (pull-up off).
The port pin (external input signal) value can be read out from
PxINy (input data). Output is disabled.
0 1 1 Functions as an input port (pull-up on). (Default)
The port pin (external input signal) value can be read out from
PxINy (input data). Output is disabled.
1 0 1 or 0 Functions as an out
put port (pull-up off).
Input is disabled. The value read from PxINy (input data) is 0.
1 1 1 or 0 Functions as an output port (pull-up off).
Input is also enabled. The port pin value (output value) can be
read out from PxINy (input data).
0 0 0 The pin is placed into high-impedance status (pull-up off).
Output and input are both disabled. The value read from PxINy
(input data) is 0.
0 0 1 The pin is placed into
high-impedance status (pull-up on).
Output and input are both disabled. The value read from PxINy
(input data) is 0.
The input/output direction of ports with a peripheral module function selected is controlled by the peripheral
module. PxOENy and PxIENy settings are ignored.
Data input
To input the port pin status and read out the value, enable input by setting PxIENy to 1 (default).
To input an ex
ternal signal, PxOENy should also be set to 0 (default). The I/O port is placed into high-imped-
ance status and it functions as an input port (input mode). The port is pulled up if pull-up is enabled by PxPUy/
Px_PU register.
In input mode, the input pin status can be read out directly from PxINy/Px_IN register. The value read will be 1
when the input pin is at High (V
DD) level and 0 when it is at Low (VSS) level.
The port pin status is always input when PxIENy is 1, even if output is enabled (PxOENy = 1) (output mode). In
this case, the value actually output from the port can be read out from PxINy.
When PxIENy is set to 0, input is disabled, and 0 will be read out from PxINy.
Data output
To output data from the port pin, enable output by setting PxOENy to 1 (set to output mode). The I/O port then
functions as an output port, and the value set in the PxOUTy/Px_OUT register is output from the port pin. The
port pin outputs High (V
DD) level when PxOUTy is set to 1 and Low (VSS) level when set to 0. Note that the
port will not be pulled up in output mode, even if pull-up is enabled by PxPUy.
Writing to PxOUTy is possible without affecting pin status, even in input mode.
Note:
P43 can only be used as an output port. For how to configure P43, see the P43MUX/P40_43PMUX
register description.

Table of Contents