In this tutorial, we will study the programming method of MSP430 MCU Gpio. This article also applies to the MSP430X2XX devices used on the Launchpad Development Board, such as msp430g2553, msp430g2231, etc. Most pins on the MSP430 microcontroller are grouped into up to 8 ports, P1 to P8. Each port is 8-bit wide and has 8 related I/O pins. These pins are mapped directly to the appropriate port registers, so the I/O pins can be operated independently. Only pins in ports P1 and P2 support interrupts. In addition, each I/O pin also has a configurable pull-up and pull-down resistor. Each port has a set of related registers that are used to manipulate each pin. The bit mappings and port groupings are as follows:
Note: The command contract for the PIN used in the Programming Guide/Data sheet is ' px.y ', where ' x ' corresponds to the port number (1 to 8), and ' Y ' corresponds to the PIN number (0 to 7) x '. For example: P1.1 is the 1th pin of Port 1, and P2.4 refers to the 4th pin of Port 2. You will see the same conventions as the marking pins on the MSP430 Launchpad board.
The current version of MSP430G2 Launchpad uses msp430g2553 and msp430g2452. Older versions (Rev1.4) use msp430g2231 and msp430g2211. However, unless otherwise noted, the programming method is the same for all supported devices.
For more information, please refer to the following link: https://www.yiboard.com/thread-772-1-1.html