7-6
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
7.4.2.
Port Input/Output Control
Peripheral I/O function control
The port for which a peripheral I/O function is selected is controlled by the peripheral circuit. For
more information, 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
PPORTP
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
PPORTP
x
DAT.P
x
IN
y
bit.
Chattering filter function
Some ports have a chattering filter function and it can be controlled in each port. This function is
enabled by setting the PPORTP
x
CHATEN.P
x
CHATEN
y
bit to 1. The input sampling time to remove
chattering is deter- mined by the CLK_PPORT frequency configured using the PPORTCLK register in
common to all ports. The chattering filter removes pulses with a shorter width than the input
sampling time.
𝐼𝑛𝑝𝑢𝑡 𝑠𝑎𝑚𝑝𝑙𝑖𝑛𝑔 𝑡𝑖𝑚𝑒 =
𝑥2 𝑡𝑜 3
𝐶𝐿𝐾_𝑃𝑃𝑂𝑅𝑇 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦! [Hz]
[𝑠𝑒𝑐𝑜𝑛𝑑] (𝐸𝑞. 6.2)
Make sure the P
xy
port interrupt is disabled before altering the PPORTCLK register and
PPORTP
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 status. Furthermore, enable the interrupt after a lapse
of four or more CLK_PPORT cycles from enabling the chattering filter function.
If the clock generator is configured so that it will supply CLK_PPORT to PPORT in SLEEP mode, the
chattering 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 PPORTCLK.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 PPORTCLK.KRSTCFG[1:0] bits.
PPORT issues a reset request immediately after all the input pins specified by the
PPORTCLK.KRSTCFG[1:0] are set to a low level if the chattering filter function is disabled (initial
status). To issue a reset request only when low-level signals longer than the time configured are
input, enable the chattering filter function for all the ports used for key-entry reset.
The pins configured for key-entry reset can also be used as general-purpose input pins.
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...