I am currently trying to make the MSP430 talk to the COM port to get a 1 or 0 when the button is pressed. The future goal would be to use a sensor and take the data from that and get a 0 or 1 for presence detection, hence why we would like to get the communication of a boolean 0/1. Using SLAA307A: Using the Timer_A UART Library, I tried to implement the basic C program, but it refuses to compile in CCSv5.
#include <ta_uart.h>
int callBack(unsigned char c);
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
TI_initTimer(callBack, _32Khz_ACLK_04800_Bitime, TASSEL_1);
_EINT();
LPM3;
}
int callBack( unsigned char c ) {
TI_TA_UART_StatusFlags &= ~TI_TA_RX_RECEIVED; // allows for RX during TX
TI_TX_Byte( c ); // echo byte
return TA_UART_STAY_LPM; // return to LPM3
}
I do know that there are some assembly files that are needed for the program to work, but I'm not sure how to link them in CCS.
Also, ideally, if this works, how does one monitor the COM port to send and receive data to the MSP?
Thanks in advance!