LM3S102 Luminary Micro, Inc, LM3S102 Datasheet - Page 104

no-image

LM3S102

Manufacturer Part Number
LM3S102
Description
Lm3s102 Arm Microcontroller
Manufacturer
Luminary Micro, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
LM3S102-EQN20-C2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S102-EQN20-C2T
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S102-IGZ-C2
Manufacturer:
TI
Quantity:
965
Company:
Part Number:
LM3S102-IGZ-C2
Quantity:
982
Part Number:
LM3S102-IQN20-C2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S102-IQN20-C2T
Manufacturer:
Texas Instruments
Quantity:
10 000
General-Purpose Input/Outputs (GPIOs)
8.2.4
8.2.5
8.2.6
8.3
104
Interrupts are cleared by writing a 1 to the GPIO Interrupt Clear (GPIOICR) register (see
page 116).
When programming interrupts, the interrupts should be masked (GPIOIM set to 0). Writing any
value to an interrupt control register (GPIOIS, GPIOIBE, or GPIOIEV) can generate a spurious
interrupt if the corresponding bits are enabled.
Mode Control
The GPIO pins can be controlled by either hardware or software. When hardware control is
enabled via the GPIO Alternate Function Select (GPIOAFSEL) register (see page 117), the pin
state is controlled by its alternate function (that is, the peripheral). Software control corresponds to
GPIO mode, where the GPIODATA register is used to read/write the corresponding pins.
Pad Configuration
The pad configuration registers allow for GPIO pad configuration by software based on the
application requirements. The pad configuration registers include the GPIODR2R, GPIODR4R,
GPIODR8R, GPIOODR, GPIOPUR, GPIOPDR, GPIOSLR, and GPIODEN registers.
Identification
The identification registers configured at reset allow software to detect and identify the module as
a GPIO block. The identification registers include the GPIOPeriphID0-GPIOPeriphID7 registers
as well as the GPIOPCellID0-GPIOPCellID3 registers.
Initialization and Configuration
To use the GPIO, the peripheral clock must be enabled by setting PORTA, PORTB, and PORTC in
the RCGC2 register.
On reset, all GPIO pins (except for the five JTAG pins) default to general-purpose input mode
(GPIODIR and GPIOAFSEL both set to 0). Table 8-1 shows all possible configurations of the
GPIO pads and the control register settings required to achieve them. Table 8-2 shows how a
rising edge interrupt would be configured for pin 2 of a GPIO port.
Table 8-1. GPIO Pad Configuration Examples
Digital Input (GPIO)
Digital Output (GPIO)
Open Drain Input (GPIO)
Open Drain Output (GPIO)
Open Drain Input/Output (I
Digital Input (Timer CCP)
Digital Output (Timer PWM)
Configuration
2
C)
0
0
0
0
1
1
1
Preliminary
X
X
X
0
1
0
1
0
0
1
1
1
0
0
1
1
1
1
1
1
1
Register Bit Value
X
X
X
?
?
?
?
X
X
X
?
?
?
?
a
X
X
X
?
?
?
?
X
X
X
?
?
?
?
July 6, 2006
X
X
X
?
?
?
?
X
X
X
?
?
?
?

Related parts for LM3S102