Hello everyone,
Am using msp430i2041 for a particular application and i want to make a I/O pin high(Vcc) when i power-up the controller. Is that possible??
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.
Hello everyone,
Am using msp430i2041 for a particular application and i want to make a I/O pin high(Vcc) when i power-up the controller. Is that possible??
With driverlib, and assuming the pin is P1.5, something like this:
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN5); GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN5);
With raw register accesses:
P1OUT |= BIT5; P1SEL0 &= ~BIT5; P1SEL1 &= ~BIT5; P1DIR |= BIT5;
But, will it make that pin high at the instant when i give power to my MSP430 Controller?? Or there will be any delay??
After startup the pin is an input with high impedance by default. You have to configure it as output - from the moment you write
P1DIR |= BIT5; // Set P1.5 to output direction
the pin will output the value that is in P1OUT.BIT5 - so you always should set P1OUT first to not get a transition from low to high since P1OUT is set to low in most cases after startup (the MSP432 behaves different - here the state is undefined by default).
If you want the pin to be high immediately after startup, then add an external pull-up-resistor to it. This will set a high signal even when the pin is still an input.
Dennis
**Attention** This is a public forum