Port Input/Output Control - Epson S1C17M20 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

Initial settings when using a port as a general-purpose input port
(only for the ports with GPIO function)
When using the Pxy port pin as a general-purpose input pin, perform the following software initial settings:
1. Write 0 to the PxINTCTL.PxIEy bit. * (Disable interrupt)
2. When using the chattering filter, configure the PPORT operating clock (see "PPORT Operating Clock") and
set the PxCHATEN.PxCHATENy bit to 1. *
When the chattering filter is not used, set the PxCHATEN.PxCHATENy bit to 0 (supply of the PPORT op-
erating clock is not required).
3. Configure the following PxRCTL register bits when pulling up/down the port using the internal pull-up or
down resistor:
- PxRCTL.PxPDPUy bit
- Set the PxRCTL.PxRENy bit to 1.
Set the PxRCTL.PxRENy bit to 0 if the internal pull-up/down resistors are not used.
4. Set the PxMODSEL.PxSELy bit to 0. (Enable GPIO function)
5. Configure the following bits when using the port input interrupt: *
- Write 1 to the PxINTF.PxIFy bit.
- PxINTCTL.PxEDGEy bit
- Set the PxINTCTL.PxIEy bit to 1.
6. Set the following PxIOEN register bits:
- Set the PxIOEN.PxOENy bit to 0.
- Set the PxIOEN.PxIENy bit to 1.
* Steps 1 and 5 are required for the ports with an interrupt function. Step 2 is required for the ports with a chat-
tering filter function.
Table 6.4.1.1 lists the port status according to the combination of data input/output control and pull-up/down
control.
PxIOEN.
PxIOEN.
PxIENy bit
PxOENy bit
0
0
0
0
0
0
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
1
*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 PxMODSEL.PxSELy 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.

6.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 infor-
mation, refer to the respective peripheral circuit chapter.
S1C17M20/M21/M22/M23/M24/M25
TECHNICAL MANUAL (Rev. 1.0)
(Select pull-up or pull-down resistor)
(Enable pull-up/down)
(Clear interrupt flag)
(Select interrupt edge (input rising edge/falling edge))
(Enable interrupt)
(Disable output)
(Enable input)
Table 6.4.1.1 GPIO Port Control List
PxRCTL.
PxRCTL.
PxRENy bit
PxPDPUy bit
0
×
1
0
1
1
0
×
1
0
1
1
0
×
1
0
1
1
1
0
1
1
Seiko Epson Corporation
6 I/O PORTS (PPORT)
Input
Output
Disabled
Disabled
Disabled
Enabled
Disabled
Enabled
Disabled
Enabled
Disabled
Disabled
Enabled
Disabled
Enabled
Disabled
Enabled
Enabled
Enabled
Enabled
Enabled
Pull-up/pull-down
condition
Off (Hi-Z) *1
Pulled down
Pulled up
Off (Hi-Z) *2
Pulled down
Pulled up
Off
Off
Off
Off
Off
6-5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17m25S1c17m21S1c17m22S1c17m23S1c17m24

Table of Contents