EmbeddedRelated.com
Forums

MSP430F427A UART pin stuck high

Started by ckuecker2000 November 10, 2009
Hello,

Working with the MSP430F427A. I am using the USART in UART mode. When I go into LPM3, I am explicitly disabling the UART and other active outputs to save power.

P2.4, the UART TX data line, goes low when I run the code with the debugger, but in a stand-alone unit, this line stays at Vdd, which results in an unwanted power drain. THe unit goes into LPM3 when it senses loss of line power - there's a supercap running the processor.

The UART drives another powered-down processor, hence the nned to keep the TX output low when in LPM3.

Here's my shutdown code:


P1DIR &= ~PIO_EEPROM_DATA; // I2C Data high (input).
P1OUT |= POUT_EEPROM_CLOCK; // I2C Clock high.
P1OUT |= POUT_BUZZER; // Buzzer inactive.
P1OUT &= ~POUT_RADIO_ENABLE; // Radio off
P2OUT &= ~FAULT_LED; // Fault LED off.
U0CTL = SWRST; // Hold the UART in Reset
ME1 &= ~(URXE0 | UTXE0); // Disble UART
P2OUT &= ~UTX0; // UART TX line driven low
LPM3; // Enter LPM3.
_NOP();


The UART is not re-enabled until the code comes out of LPM3, which occurs when line power is restored. The re-enable code works correctly.

Am I missing something?

Beginning Microcontrollers with the MSP430

You have to additionally set P2SEL for utx0 low while in LPM3 to
allow your P2OUT command for utx0 to take effect, ME1 does not do
this for you. On exit from LPM3 set that P2SEL bit high again. The
same applies to other i/o pins which you are using with the PxSEL bits high.
Hugh

At 10:49 AM 11/10/2009, you wrote:
>Hello,
>
>Working with the MSP430F427A. I am using the USART in UART mode.
>When I go into LPM3, I am explicitly disabling the UART and other
>active outputs to save power.
>
>P2.4, the UART TX data line, goes low when I run the code with the
>debugger, but in a stand-alone unit, this line stays at Vdd, which
>results in an unwanted power drain. THe unit goes into LPM3 when it
>senses loss of line power - there's a supercap running the processor.
>
>The UART drives another powered-down processor, hence the nned to
>keep the TX output low when in LPM3.
>
>Here's my shutdown code:
>
>
> P1DIR &= ~PIO_EEPROM_DATA; // I2C Data high (input).
> P1OUT |= POUT_EEPROM_CLOCK; // I2C Clock high.
> P1OUT |= POUT_BUZZER; // Buzzer inactive.
> P1OUT &= ~POUT_RADIO_ENABLE; // Radio off
> P2OUT &= ~FAULT_LED; // Fault LED off.
> U0CTL = SWRST; // Hold the UART in Reset
> ME1 &= ~(URXE0 | UTXE0); // Disble UART
> P2OUT &= ~UTX0; // UART TX line driven low
> LPM3; // Enter LPM3.
> _NOP();
>
The UART is not re-enabled until the code comes out of LPM3, which
>occurs when line power is restored. The re-enable code works correctly.
>
>Am I missing something?
>
>
Thanks, Hugh. That did the trick. Cut my current consumption in LPM3 in half.

--- In m..., Hugh Molesworth wrote:
>
> You have to additionally set P2SEL for utx0 low while in LPM3 to
> allow your P2OUT command for utx0 to take effect, ME1 does not do
> this for you. On exit from LPM3 set that P2SEL bit high again. The
> same applies to other i/o pins which you are using with the PxSEL bits high.
> Hugh
>
> At 10:49 AM 11/10/2009, you wrote:
> >Hello,
> >
> >Working with the MSP430F427A. I am using the USART in UART mode.
> >When I go into LPM3, I am explicitly disabling the UART and other
> >active outputs to save power.
> >
> >P2.4, the UART TX data line, goes low when I run the code with the
> >debugger, but in a stand-alone unit, this line stays at Vdd, which
> >results in an unwanted power drain. THe unit goes into LPM3 when it
> >senses loss of line power - there's a supercap running the processor.
> >
> >The UART drives another powered-down processor, hence the nned to
> >keep the TX output low when in LPM3.
> >
> >Here's my shutdown code:
> >
> >
> > P1DIR &= ~PIO_EEPROM_DATA; // I2C Data high (input).
> > P1OUT |= POUT_EEPROM_CLOCK; // I2C Clock high.
> > P1OUT |= POUT_BUZZER; // Buzzer inactive.
> > P1OUT &= ~POUT_RADIO_ENABLE; // Radio off
> > P2OUT &= ~FAULT_LED; // Fault LED off.
> > U0CTL = SWRST; // Hold the UART in Reset
> > ME1 &= ~(URXE0 | UTXE0); // Disble UART
> > P2OUT &= ~UTX0; // UART TX line driven low
> > LPM3; // Enter LPM3.
> > _NOP();
> >

> >
> >The UART is not re-enabled until the code comes out of LPM3, which
> >occurs when line power is restored. The re-enable code works correctly.
> >
> >Am I missing something?
> >
> >
> >
> >
> >
> >
> >
> >