SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
To configure the GPIO pins of a particular port, follow these steps:
NOTE
To prevent false interrupts, the following steps should be taken when reconfiguring GPIO edge and interrupt sense registers:
When the internal POR signal is asserted and until otherwise configured, all GPIO pins are configured to be undriven (tristate): GPIOAFSEL = 0, GPIODEN = 0, GPIOPDR = 0, and GPIOPUR = 0Table 17-2 shows all possible configurations of the GPIO pads and the control register settings required to achieve them. Table 17-3 shows how a rising edge interrupt is configured for pin 2 of a GPIO port.
Configuration | GPIO Register Bit Value (1) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AFSEL | DIR | ODR | DEN | PUR | PDR | DR2R | DR4R | DR8R | DR12R | SLR | |
Digital Input (GPIO) | 0 | 0 | 0 | 1 | ? | ? | X | X | X | X | X |
Digital Output (GPIO) | 0 | 1 | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Open Drain Output (GPIO) | 0 | 1 | 1 | 1 | X | X | ? | ? | ? | ? | ? |
Open Drain Input/Output (I2CSDA) | 1 | X | 1 | 1 | X | X | ? | ? | ? | ? | ? |
Digital Input/Output (I2CSCL) | 1 | X | 0 | 1 | X | X | ? | ? | ? | ? | ? |
Digital Input (Timer CCP) | 1 | X | 0 | 1 | ? | ? | X | X | X | X | X |
Digital Input (QEI) | 1 | X | 0 | 1 | ? | ? | X | X | X | X | X |
Digital Output (PWM) | 1 | X | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Digital Output (Timer PWM) | 1 | X | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Digital Input/Output (SSI) | 1 | X | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Digital Input/Output (UART) | 1 | X | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Analog Input (Comparator) | 0 | 0 | 0 | 0 | 0 | 0 | X | X | X | X | X |
Digital Output (Comparator) | 1 | X | 0 | 1 | ? | ? | ? | ? | ? | ? | ? |
Register | Desired Interrupt Event Trigger | Pin 2 Bit Value (1) | |||||||
---|---|---|---|---|---|---|---|---|---|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
GPIOIS | 0 = edge
1 = level |
X | X | X | X | X | 0 | X | X |
GPIOIBE | 0 = single edge
1 = both edges |
X | X | X | X | X | 0 | X | X |
GPIOIEV | 0 = Low level, or falling edge
1 = High level, or rising edge |
X | X | X | X | X | 1 | X | X |
GPIOIM | 0 = masked
1 = not masked |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |