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.

MSP430F2002: Guaranteeing good power-up behavior in an output port (P1.4) used to power system down

Part Number: MSP430F2002

I am designing an embedded product based on the TMS430F20x2.
I am using port P1.4 to toggle an external flip/flop that powers down my system. The control signal is asserted low.
We need to ensure that the microprocessor's port behavior during power up and also coming out from sleep will not accidentally power off my system.
I plan to use the internal port's pull-up resistor, and to configure port P1.4 as an output.
The microprocessor's pin voltage must absolutely stay high all the time, including power up and coming out from sleep, and only drop to zero upon explicit command to avoid unintended system power off.
Can someone give me advice on how I can ensure this without using an external pull-up resistor?

Thanks

  • No GPIO pin is an output until the CPU has started executing your code that changes the configuration.

    So software cannot affect the pin state during startup. You have to use a pullup.
    Alternatively, enable the flipflop only after the CPU has started.
  • Clemens,

    Thanks for your prompt response to my question.

    When you mention I have to use a pull-up do you mean an external pull-up?
    I need to rely on the microprocessor's internal pull-up. I don't have any space left on the board for additional components.

    Also, in order to avoid spurious behavior, I want to ask you what is the correct instruction order to configure the pin in the software?

    Right now I have it like this:

    //Enable pull-up/pull-down resistor in P1.5
    P1REN = BIT5;

    //Select pull-up resistor on P1.5
    P1OUT = BIT4 ;

    // Set P1.5 as output
    P1DIR = BIT5;
  • Yes, the only way to affect the pin during startup is to use an external pullup.

    You should set PxOUT.x before enabling PxREN.x.
    And choose if you want to use P1.4 or P1.5.

**Attention** This is a public forum