MSP430 Pin Variables

msp430pinoutti-ccstudio

I am trying to program an MSP430FR5969 for the first time. I successfully executed and modified a program to blink one of the LEDs connected to P1.0. The relevant predefined variable is P1OUT.

The other LED is connected to P4.6 but I do not know which variable corresponds to it. P4OUT doesn't seem to work, and I am not sure it is the right one because there are several pins: P4.4, P4.5, P4.6 and the variable P4OUT doesn't seem to differentiate between them.

What is the variable naming scheme? More importantly, what reference document would answer similar questions?

Best Answer

the . means a particular bit of a multi-bit output. P4 is not really one pin but a bank of pins! :)

    P4DIR |= BIT6;  /* set P4.6 to output */
    P4OUT |= BIT6;  /* set P4.6 to 1 */
    P4OUT &= ~BIT6; /* set P4.6 to 0 */