UM10429
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2010. All rights reserved.
User manual
Rev. 1 — 20 October 2010
64 of 258
NXP Semiconductors
UM10429
Chapter 9: LPC1102 General Purpose I/O (GPIO)
9.3.1 GPIO data register
The GPIOnDATA register holds the current logic state of the pin (HIGH or LOW),
independently of whether the pin is configured as an GPIO input or output or as another
digital function. If the pin is configured as GPIO output, the current value of the
GPIOnDATA register is driven to the pin.
A read of the GPIOnDATA register always returns the current logic level (state) of the pin
independently of its configuration. Because there is a single data register for both the
value of the output driver and the state of the pin’s input, write operations have different
effects depending on the pin’s configuration:
•
If a pin is configured as GPIO input, a write to the GPIOnDATA register has no effect
on the pin level. A read returns the current state of the pin.
•
If a pin is configured as GPIO output, the current value of GPIOnDATA register is
driven to the pin. This value can be a result of writing to the GPIOnDATA register, or it
can reflect the previous state of the pin if the pin is switched to GPIO output from
GPIO input or another digital function. A read returns the current state of the pin.
•
If a pin is configured as another digital function (input or output), a write to the
GPIOnDATA register has no effect on the pin level. A read returns the current state of
the pin even if it is configured as an output. This means that by reading the
GPIOnDATA register, the digital output or input value of a function other than GPIO on
that pin can be observed.
The following rules apply when the pins are switched from input to output:
•
Pin is configured as input with a HIGH level applied:
–
Change pin to output: pin drives HIGH level.
•
Pin is configured as input with a LOW level applied:
–
Change pin to output: pin drives LOW level.
The rules show that the pins mirror the current logic level. Therefore floating pins may
drive an unpredictable level when switched from input to output.
GPIOnMIS
R
0x8018
Masked interrupt status register for port n
0x00
GPIOnIC
W
0x801C
Interrupt clear register for port n
0x00
-
-
0x8020 - 0xFFFF
reserved
0x00
Table 60.
Register overview: GPIO (base address port 0: 0x5000 0000; port 1: 0x5001 0000)
Name
Access
Address offset
Description
Reset
value
Table 61.
GPIOnDATA register (GPIO0DATA, address 0x5000 0000 to 0x5000 3FFC;
GPIO1DATA, address 0x5001 0000 to 0x5001 3FFC; GPIO2DATA, address 0x5002
0000 to 0x5002 3FFC; GPIO3DATA, address 0x5003 0000 to 0x5003 3FFC) bit
description
Bit
Symbol
Description
Reset
value
Access
11:0
DATA
Logic levels for pins PIOn_0 to PIOn_11. HIGH = 1, LOW =
0.
n/a
R/W
31:12
-
Reserved
-
-