This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-EXP430FR5969 controlling the BoosterPack connector pin P1.2 (or any BoosterPack connector pin)

Other Parts Discussed in Thread: MSP-EXP430FR5969

The program pasted below blinks both the Green and Red LEDs (connected to P1.0 and P4.6 respectively) on MSP-EXP430FR5969 Launchpad.
But I intend to do one more thing - i.e. control P1.2 which is coming out as BoosterPack Connector Pin. When I use a multi-meter to measure the voltage, I see that it is always zero (I have ensured that I have sufficient delay like 3 to 5 seconds to change / blink LEDs).

How can I control P1.2 coming out as BoosterPack connector pin??

#include <msp430.h>

int main(void) {
    WDTCTL = WDTPW | WDTHOLD;               // Stop watchdog timer
    PM5CTL0 &= ~LOCKLPM5;                   // Disable the GPIO power-on default high-impedance mode
                                            // to activate previously configured port settings
    P1DIR |= 0x01;                          // Set P1.0 to output direction
    P4DIR |= 0b01000000;

    for(;;) {
        volatile unsigned int i;            // volatile to prevent optimization

        P1OUT ^= 0x05;                      // Toggle P1.0 and P1.2 using exclusive-OR
        P4OUT ^= 0x40;

        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        i = 50000;                          // SW Delay
        do i--;
        while(i != 0);
        }
    return 0;
}

  • user1818927 said:
    How can I control P1.2 coming out as BoosterPack connector pin??

    You need to set bit 2 of P1DIR; the code above leaves P1.2 in input mode. Since bit 2 of P1REN will also be clear by default you'll see no change in voltage at the pin when toggling P1OUT bit 2.

    As an aside, rather than using loops to implement delays like that it's better to use __delay_cycles(). The compiler will replace that with code that spins for the specified number of clock cycles. That makes it easier to know exactly how long the delays will be, and it makes the code a bit easier to follow.

  • Thank you.


    How much delay comes from __delay_cycles(1) ? In other words how much is one cycle or delay clock frequency?

    And, I was actually trying to interface a JHD 162A 16x2 LCD to MSP-EXP430FR5969 Launchpad. Is there a library given from TI or community to do this? Or should we write our own?

    Thanks

    Chanakya K V (TI-India-Bangalore)

  • The parameter to __delay_cycles() specifies the number of MCLK cycles to wait. In other words, if MCLK is 1MHz then the delay is in microseconds.

**Attention** This is a public forum