I have this code, but it's not working:
void configUART()
{
UCA0CTL1 &= ~UCSWRST; // stop software reset of uart
UCA0CTL0 = 0x00; // default mode...8 data bits, 1 stop //bit, async
UCA0CTL1 |= BIT7; //SMCLK, which is set to 16MHz
// for baud of 9600 we want prescalar = 1666; that's //130 + 6*256
UCA0BR1 = 0x06; // 6
UCA0BR0 = 0x82; // 130
UCA0MCTL = 0x0C; // UCBRSx = 6
P1DIR |= BIT2; // select output pin
P1SEL |= BIT2; // choose UART option for pin
P1SEL2 |= BIT2;
}
I then have a while loop, and in it I set UCA0TXBUF = 0x55; However nothing is showing on the terminal program (putty). I selected the right COM port (10) and the correct baud rate (9600).