I am trying to use the usart using a poll instead of the ISR and Im having trouble. I am using hyper term and it gets the char, but instead of repeating it once it continues to repeat it until I press the next ch and it repeats that.
P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 9; // 1MHz 115200 (see User's Guide)
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL |= UCBRS_1 + UCBRF_0; // Modulation UCBRSx=1, UCBRFx=0
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
while(1)
{
if(UCRXIFG == 1)
{
UCA0TXBUF = UCA0RXBUF;
}
}
}