Hellow, I want to communicate the MSP430F2252 with a GSM through UART. I'm using the printf function to do this, but I've read in several post you have to modify the putchar.c file or write your own putchar function. I haven't found the putchar.c file in the directory where I have the IAR installed, but in this post http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/63128.aspx#227027 I've found this c code:
// putchar function to write standard output to serial port
#include "xstdio.h"
#include <processor_specific.h>
_STD_BEGIN
int (putchar)(int c)
{
// **** BEGIN SPECIFIC CODE FOR ANSI TERMINAL ***** //
//
// For I/O with ANSI terminal (or equivalent), convert C
// line end (\n) to carriage-return + linefeed combo (\r\n).
//
if (c == '\n') putchar('\r');
//
// (**** END SPECIFIC CODE FOR ANSI TERMINAL ***** //
if (c != EOF)
{
while (!(UCA0IFG & UCTXIFG))
{
// keep waiting;
}
UCA0TXBUF = c;
}
return (c);
}
_STD_END
The problem is: I don't know if it is correct because another member of the comunity wrote that it isn't fully correct, besides this I don't have my board yet.
Thanks in advance, Biara.