
ViPeRiPheRaLMoDuLes4(PoRts):GeneRaL-PuRPosei/oPoRts(GPio)
s1C33L17teChniCaLManuaL
ePson
Vi-1-1
VI
GPIO
VI.1 General-Purpose I/O Ports (GPIO)
Vi.1.1structureofi/oPort
The S1C33L17 contains 74 I/O ports (P0[7:0], P1[7:0], P2[7:0], P3[6:0], P4[7:0], P5[7:0], P6[7:0], P7[4:0],
P8[5:0], and P9[7:0]) that can be directed for input or output through the use of a program. Although each pin is
used for input/output from/to the internal peripheral circuits, some pins can be used as general-purpose input/output
ports unless they are used for the peripheral circuits.
Figure VI.1.1.1 shows the structure of a typical I/O port.
VDDH
VSS
Internaldatabus
Pxx
Data
register
Peripheralcircuit
input
Peripheralcircuit
output
I/Ocontrol
register
Peripheralcircuit
I/Ocontrol
Function
selectregister
I/Ocontrol
signal
FigureVI.1.1.1StructureofI/OPort
note: Apull-upresistorisprovidedforeachpinanditcanbeenabled/disabledbysoftwarecontrol.Re-
fertoSectionIII.4.4,“PinControlRegisters,”forhowtocontrolthepull-upresistor.
Whentheportisinoutputmode,theportpinisnotpulledupregardlessofhowthepull-upcontrol
bitisset.
Vi.1.2selectingthei/oPinFunctions
The I/O ports concurrently serve as the input/output pins for peripheral circuits or bus signals. Whether they are
used as I/O ports or for peripheral circuits/bus signals can be selected bit-for-bit using the port function select regis-
ters. All pins not used for peripheral circuits/bus signals can be used as general-purpose I/O ports.
Each I/O port pin (Pxx) is initialized for a default function at initial reset.
For the pin that has two or more functions assigned, the port extended function select bits (CFPxx[1:0]) provided
for each I/O port pin can be used to select the desired function.
For details of pin functions and how to switch over, see Section I.3.3, “Switching Over the Multiplexed Pin Func-
tions.”
The subsequent sections explain the port functions assuming that the pin has been set as a general-purpose I/O port.
note: TousetheP15–P17andP34–P36pinsthatareconfiguredasthedebuginterfacepinsbydefault
forgeneral-purposeinputs/outputs,clearTRCMUX(D0/0x300014)to0.
*tRCMuX:P15–17,P34–36DebugFunctionSelectBitintheDebugPortMUXRegister(D0/0x300014)
Note,however,thatthePCtracefunctionofthedebuggercannotbeusedwhenTRCMUX(D0/
0x300014)issetto0.