24 I/O PORTS (GPIO)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
24-11
Address
Register name
Function
0x300819 PMUX_PC_47
PC[7:4] Port Function Select Register
Select PC[7:4] port functions
0x30083e GPIO_FILTER
Port Noise Filter Control Register
Enable/disable port input noise filter
0x30083f GPIO_PROTECT
GPIO/PMUX Write Protect Register
Enable/disable write protection for PMUX, GPIO_FIL-
TER, GPIO_BUS_DRV, and GPIO_P
x
_PUP registers
The I/O port registers are described in detail below. These are 8-bit registers.
Notes: • When data is written to the registers, the “Reserved” bits must always be written as 0 and not 1.
• The GPIO_BUS_DRV register, GPIO_P
x
_PUP registers, GPIO_FILTER register, and PMUX_
P
x
_
yy
registers are write-protected. Before these registers can be rewritten, the write protec-
tion must be removed by writing data 0x96 to PPROT[7:0]GPIO_PROTECT register. Note
that since unnecessary rewrites to these registers could lead to erratic system operation,
PPROT[7:0] should be set to other than 0x96 unless the registers above must be rewritten.
P
x
Port Data Registers (GPIO_P
x
_DAT)
Register name Address
Bit
Name
Function
Setting
Init. R/W
Remarks
P
x
Port Data
Register
(GPIO_P
x
_DAT)
0x300300
0x300302
|
0x300318
(8 bits)
D7–0 P
x
[7:0]D
P
x
[7:0] I/O port data
1 1 (High)
0 0 (Low)
Ext. R/W Ext.: Depends on
the external pin
status.
Note: The P
xy
D bits for unavailable pins are read only bits from which 0 is always read out.
D[7:0]
P
x
[7:0]D: P
x
[7:0] I/O Port Data Bits
These bits are used to read data from I/O-port pins or to set output data. (Default: external pin status)
1 (R/W): High level
0 (R/W): Low level
P
xy
D corresponds directly to the P
xy
pin.
The pin voltage level can be read out (even if the port is set to output mode (IOC
xy
/GPIO_P
x
_IOC reg-
ister = 1)). The value read out will be 1 when the pin voltage is high and 0 when low.
When the port is set to output mode (IOC
xy
/GPIO_P
x
_IOC register = 1), the data written will be output
unchanged from the port pins. The port pin will be high when the data bit is set to 1 and low when set to 0.
Port data can also be written in input mode (IOC
xy
= 0) (the pin status is unaffected).
P
x
Port I/O Control Registers (GPIO_P
x
_IOC)
Register name Address
Bit
Name
Function
Setting
Init. R/W
Remarks
P
x
Port I/O
Control Register
(GPIO_P
x
_IOC)
0x300301
0x300303
|
0x300319
(8 bits)
D7–0 IOC
x
[7:0]
P
x
[7:0] I/O control
1 Output
0 Input
0x0 R/W
Note: The IOC
xy
bits for unavailable pins are read only bits from which 0 is always read out.
D[7:0]
IOC
x
[7:0]: P
x
[7:0] I/O Control Bits
Sets the port to input or output mode.
1 (R/W): Output mode
0 (R/W): Input mode (default)
IOC
xy
is the I/O direction control bit that corresponds directly to P
xy
port. Setting to 1 enables output
and the data set in P
xy
D is output from the port pin. Output is disabled when IOC
xy
is set to 0, and the
port pin is set into high-impedance status for inputting an external signal. The peripheral module deter-
mines whether output is enabled or disabled when the port is used for a peripheral module function.