6 I/O PORTS (PPORT)
S1C17F13 TeChniCal Manual
Seiko epson Corporation
6-5
(Rev. 1.0)
4.1.1 GPIO Port Control List
Table 6.
P
x
IOEN.
P
x
IEN
y
bit
P
x
IOEN.
P
x
OEN
y
bit
P
x
RCTL.
P
x
REN
y
bit
P
x
RCTL.
P
x
PDPU
y
bit
Input
Output
Pull-up/pull-down
condition
0
0
0
×
Disabled
Off (Hi-Z)
*
1
0
0
1
0
Disabled
Pulled down
0
0
1
1
Disabled
Pulled up
1
0
0
×
Enabled
Disabled
Off (Hi-Z)
*
2
1
0
1
0
Enabled
Disabled
Pulled down
1
0
1
1
Enabled
Disabled
Pulled up
0
1
0
×
Disabled
Enabled
Off
0
1
1
0
Disabled
Enabled
Off
0
1
1
1
Disabled
Enabled
Off
1
1
1
0
Enabled
Enabled
Off
1
1
1
1
Enabled
Enabled
Off
*
1: Initial status. Current does not flow if the pin is placed into floating status.
*
2: Use of the pull-up or pull-down function is recommended, as undesired current will flow if the port input is set to floating status.
Note: If the P
x
MODSEL.P
x
SEL
y
bit for the port without a GPIO function is set to 0, the port goes into
initial status (refer to “Initial Settings”). The GPIO control bits are configured to a read-only bit al-
ways read out as 0.
Port Input/Output Control
6.4.2
Peripheral I/O function control
The port for which a peripheral I/O function is selected is controlled by the peripheral circuit. For more infor-
mation, refer to the respective peripheral circuit chapter.
Setting output data to a GPIO port
Write data (1 = high output, 0 = low output) to be output from the P
xy
pin to the P
x
DAT.P
x
OUT
y
bit.
Reading input data from a GPIO port
The data (1 = high input, 0 = low input) input from the P
xy
pin can be read out from the P
x
DAT.P
x
IN
y
bit.
Chattering filter function
Some GPIO ports have a chattering filter function and it can be controlled in each port. This function is enabled
by setting the P
x
CHATEN.P
x
CHATEN
y
bit to 1. The input sampling time to remove chattering is determined
by the CLK_PPORT frequency configured using the PCLK register in common to all ports. The chattering filter
removes pulses with a shorter width than the input sampling time.
3
Input sampling time = ———————————— [second]
(Eq.6.2)
CLK_PPORT frequency [Hz]
Make sure the P
xy
port interrupt is disabled before altering the PCLK register and P
x
CHATEN.P
x
CHATEN
y
bit settings. A P
xy
port interrupt may erroneously occur if these settings are altered in an interrupt enabled sta-
tus. Furthermore, enable the interrupt after a lapse of four or more CLK_PPORT cycles from enabling the chat-
tering filter function.
If the clock generator is configured so that it will supply CLK_PPORT to PPORT in SLEEP mode, the chatter-
ing filter of the port will function even in SLEEP mode. If CLK_PPORT is configured to stop in SLEEP mode,
PPORT inactivates the chattering filter during SLEEP mode to input pin status transitions directly to itself.
Key-entry reset function
This function issues a reset request when low-level pulses are input to all the specified ports simultaneously.
Make the following settings when using this function:
1. Configure the ports to be used for key-entry reset as general-purpose input ports (refer to “Initial settings
when using a port as a general-purpose input port (only for the ports with GPIO function)”).
2. Configure the input pin combination for key-entry reset using the PCLK.KRSTCFG[1:0] bits.
Note: When enabling the key-entry reset function, be sure to configure the port pins to be used for it
as general-purpose input pins before setting the PCLK.KRSTCFG[1:0] bits.