Section 40 General Purpose I/O (GPIO)
Rev. 1.00 Oct. 01, 2007 Page 1758 of 1956
REJ09B0256-0100
40.3 Usage
Examples
Example procedures for configuring general-purpose input/output ports (GPIO) are shown below.
40.3.1 Port
Output
Function
To set up a pin for the port output function, write B'01 to the corresponding two bits in the port
control register (PACR to PPCR). This allows the data of the corresponding bit in the port data
register (PADR to PPDR) to be output from that pin.
Note that settings in the pull-up control register (PAPUPR to PPPUPR) and pin select register
(PSEL0 to PSEL4) are invalid for the pins configured for the port output function.
40.3.2
Port Input Function
To set up a pin for the port input function, write B'10 (when not using MOS pull-up) or B'11
(when using MOS pull-up) to the corresponding two bits in the port control register (PACR to
PPCR). This allows the value of that pin to be read from the corresponding bit in the port data
register (PADR to PPDR).
Note that settings in the pull-up control register (PAPUPR to PPPUPR) and pin select register
(PSEL0 to PSEL4) are invalid for the pins configured for the port output function.
40.3.3
Peripheral Module Function
To set up a pin for use by peripheral modules, first set the pin select register (PSEL0 to PSEL4) to
select the module that uses that pin.
Then, if the pin is to be used as an input or input/output pin, set the pull-up control register
(PAPUPR to PPPUPR) to create the MOS pull-up setting: to the corresponding bit, write 0 when
not using the MOS pull-up or write 1 when using the MOS pull-up. For a pin used for output, the
MOS pull-up is always turned off for any setting of the pull-up control register.
Finally, write B'00 to the corresponding two bits in the port control register (PACR to PPCR).
Summary of Contents for SH7763
Page 2: ...Rev 1 00 Oct 01 2007 Page ii of lxvi ...
Page 122: ...Section 2 Programming Model Rev 1 00 Oct 01 2007 Page 56 of 1956 REJ09B0256 0100 ...
Page 144: ...Section 3 Instruction Set Rev 1 00 Oct 01 2007 Page 78 of 1956 REJ09B0256 0100 ...
Page 170: ...Section 4 Pipelining Rev 1 00 Oct 01 2007 Page 104 of 1956 REJ09B0256 0100 ...
Page 282: ...Section 7 Caches Rev 1 00 Oct 01 2007 Page 216 of 1956 REJ09B0256 0100 ...
Page 378: ...Section 9 Interrupt Controller INTC Rev 1 00 Oct 01 2007 Page 312 of 1956 REJ09B0256 0100 ...
Page 514: ...Section 12 DDR SDRAM Interface DDRIF Rev 1 00 Oct 01 2007 Page 448 of 1956 REJ09B0256 0100 ...
Page 630: ...Section 13 PCI Controller PCIC Rev 1 00 Oct 01 2007 Page 564 of 1956 REJ09B0256 0100 ...
Page 710: ...Section 16 Clock Pulse Generator CPG Rev 1 00 Oct 01 2007 Page 644 of 1956 REJ09B0256 0100 ...
Page 732: ...Section 17 Watchdog Timer and Reset WDT Rev 1 00 Oct 01 2007 Page 666 of 1956 REJ09B0256 0100 ...
Page 752: ...Section 18 Power Down Mode Rev 1 00 Oct 01 2007 Page 686 of 1956 REJ09B0256 0100 ...
Page 772: ...Section 19 Timer Unit TMU Rev 1 00 Oct 01 2007 Page 706 of 1956 REJ09B0256 0100 ...
Page 824: ...Section 21 Compare Match Timer CMT Rev 1 00 Oct 01 2007 Page 758 of 1956 REJ09B0256 0100 ...
Page 1124: ...Section 26 I 2 C Bus Interface IIC Rev 1 00 Oct 01 2007 Page 1058 of 1956 REJ09B0256 0100 ...
Page 1350: ...Section 30 SIM Card Module SIM Rev 1 00 Oct 01 2007 Page 1284 of 1956 REJ09B0256 0100 ...
Page 1484: ...Section 33 Audio Codec Interface HAC Rev 1 00 Oct 01 2007 Page 1418 of 1956 REJ09B0256 0100 ...
Page 1560: ...Section 35 USB Host Controller USBH Rev 1 00 Oct 01 2007 Page 1494 of 1956 REJ09B0256 0100 ...
Page 1720: ...Section 37 LCD Controller LCDC Rev 1 00 Oct 01 2007 Page 1654 of 1956 REJ09B0256 0100 ...
Page 2025: ......
Page 2026: ...SH7763 Hardware Manual ...