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.

LP-MSP430FR2476: About GPIO settings

Part Number: LP-MSP430FR2476

When using P2.3 of LP-MSP430FR2476 as an input pin
GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P2,GPIO_PIN3);
If I enable the internal pull-up resistor, it will work without any problems, but
Since there is an external pull-up resistor connected to P2.3, I thought I would disable the internal pull-up resistor,
GPIO_setAsInputPin(GPIO_PORT_P2,GPIO_PIN3);
When I changed the code like this, the switch stopped responding.
Does this mean that even if there is an external pull-up, it is necessary to set the internal pull-up?
Is there a way to not use internal resistance?

  • Actually, it should work. Can you check the IO input by using GPIO_getInputPinValue(), whether it follows the voltage change on this pin.  

  • #include <driverlib.h>
    
    int main(void) {
    
        volatile uint32_t i;
    
        // Stop watchdog timer
        WDT_A_hold(WDT_A_BASE);
    
        GPIO_setAsInputPin(GPIO_PORT_P2,GPIO_PIN3);
        GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P2,GPIO_PIN3);
        GPIO_getInputPinValue(GPIO_PORT_P2,GPIO_PIN3);
    
    
    
        while(1)
        {
              ;
    
    
    }
    }
    

    I have assembled the circuit as shown above, but how should I check it?

  • By the way,
    GPIO_setAsInputPin(GPIO_PORT_P2,GPIO_PIN3);
    In the case of GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P2,GPIO_PIN3);, the register "P2IN" changes to "0x08" at SW_OFF and "0x00" at SW_ON.
    If only GPIO_setAsInputPin(GPIO_PORT_P2,GPIO_PIN3);
    Register "P2IN" is "0x00" for both SW_OFF and SW_ON.

  • On my Launchpad (Rev A), the external pullup on P2.3 (R10) isn't populated.

    Also, at some point you need to call

    >  PMM_unlockLPM5();

  • We apologize for the inconvenience.
    When I checked the evaluation board, I found that the SW external pull-up resistors "R9" and "R10" were not installed.
    Thank you for your advice.

    Regarding "PMM_unlockLPM5();", GPIO input/output can be set without any problem without writing any code, but what are the concerns if PMM_unlockLPM5(); is not executed?

  • Please see the comment:

    That if for contolling GPIO which is setted in output mode. As your GPIO is in input mode(High impendence). You can remove this function.

**Attention** This is a public forum