Hi,
I have a problem when i try to reset my uscia. I am doing this between sent packages but the last byte is sent is modified...
I am doing the following in my isr:
#pragma vector = USCIAB0TX_VECTOR
__interrupt void USCIAB0TX_ISR(void)
{
if((IFG2&UCA0TXIFG)&&(IE2&UCA0TXIE)) //INTERRUPCION SERIAL
{
if ( contador_bytes_out != total_bytes_out)
{
UCA0TXBUF = mensaje_out[contador_bytes_out]; // TX next character
contador_bytes_out++;
}
else
{
contador_bytes_out = 0;
IE2 &= ~UCA0TXIE;
__bic_SR_register_on_exit(LPM3_bits); // Exit LPM0
}
}
}
When i get out of the ISR i turn off the USCIA:
UCA0CTL1 |= UCSWRST;
What do you suggest?
I need this to reduce my power consumption on idle state...