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!
Vinay Dandekarit refuses to compile
What, exactly, do you mean by that?
I presume you mean that you get lots of error and/or warning messages? Have you looked carfully at those messages, and attempted to resolve them?
Hi Vinay,
when you say it refuses to compile - please provide the errors and warnings.
A pure "C" version is available here: https://gist.github.com/532047
You can use almost any good(tm) terminal program to show the data. Hyperterminal or TinyTerm are two simple ones.
--Regards,JanOxfam Trailwalker 2012 - Runner
Found any horribly english mistakes? - Drop me a note as private conversation via my profile if you like ;-)
Sorry for the long wait, but I finally got the answer I was looking for through some of the sample code sitting in SLAC485A.zip for the MSP430G2xx3 examples. The msp430g2xx3_uscia0_uart_01_9600.c was a great start for our simple project of sending just one byte to the COM port.