I am using the MSP430F5529 launchpad and I've tried both writing my own UART code as well as use examples I found the MSP430 Resources in CCS, however I can't seem to get a response through my terminal. I've used Real Term HTerminal and Putty, even tried a second computer and second launchpad. Could someone take a look at my code and point me in the right direction please?
#include <msp430.h>
#include <stdio.h>
/*
* Tests UART TX and RX
* main.c
*/
//FUNCTION PROTOTYPES
void OUTA_UART(unsigned int A);
unsigned int INA_UART(void);
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
unsigned int a;
//Initialize UART Control
UCSCTL4 |= SELA_2; // ACLK = REFOCLK = 32768 Hz
P3SEL |= BIT3 + BIT4; //Select P3.3 and P3.4
P3DIR |= 0x08; // P3.3 is TX output
UCA0CTL0 |= 0x20; // MSB first
UCA0CTL1 |= 0x41;
UCA0BR1 = 0;
UCA0BR0 = 3; //32768/9600
UCA0MCTL |= 0x06; // BRF = 0 BRS = 3
UCA0STAT = 0;
UCA0CTL1 &= ~UCSWRST;
_bis_SR_register(GIE);
_no_operation();
for(;;) {
a = INA_UART();
OUTA_UART(a);
}
return 0;
}
void OUTA_UART(unsigned int A) {
do {
}
while (!(UCA0IFG & UCTXIFG));
UCA0TXBUF = A;
}
unsigned int INA_UART (void) {
do {
}
while(!(UCA0IFG & UCRXIFG));
return (UCA0RXBUF);
}