Site Search

Texas Instruments MSP430 Series: What if I want to configure multiple ports in Port Settings?

MCU MSP430 series

The port register consists of 8 bits, and bit 0 to bit 8 are associated with each port number.
For example, if you want to set P1.0 and P1.6, you need to set bits 0 and 6 of register P1OUT, which sets the output High/Low of ports 1.0 to 1.7.

In the microcomputer program, the numerical value that sets the register is defined by function and content, such as BIT0 (= 00000001), so that the user can understand the program by looking at it, so the program is written like P1OUT |= BIT0 + BIT6 I will describe. Since the ORed value of 00000001 and 01000000 is inserted into the register P1OUT, it becomes 01000001.


Experienced FAE
Free consultation is available.

From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.