Rewriting putchar() on MSP430F149

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I think, that only reasonable way to make terminal connection between
MSP430F149 <-> PC, is to rewrite low-level fuction putchar() to use
USART and let upper-level functions like printf() to make all the
conversions needed.
I'm using IAR and/or mspgcc. How do I replace putchar.o in library
files needed, and what are those lib-files in both systems?

Re: Rewriting putchar() on MSP430F149
Quoted text here. Click to load it

I use uprintf() which sends output one character at a time to a
myself and contains low level code to push characters out through the
UART. I have this function in my program so it is not a library as such.

My print statements look like this:
uprintf(my_designated_function, "Hello world" );

Let me know if you would like more detail.


Re: Rewriting putchar() on MSP430F149

Quoted text here. Click to load it

With IAR putchar() calls some function _cantrember(), IIRC.
This function can be declared anywhere in your project.

It must be somewhere in the IAR help. I don't have IAR at home, but I
will look it up at work tomorrow (if I don't forget ;-)


Re: Rewriting putchar() on MSP430F149
It is quite easy, and documented in the configuration section of the C
compiler reference manual.  The putchar() function calls
__low_level_put() into which you put your serial transmit function
call.  In my case:

static void __low_level_put( int Character )
USART_0_TX_Char( (unsigned char) Character ) ;

IAR have an app note on the web site that covers the use of the serial
port quite comprehensively and includes the implementation of a
buffered, interrupt driven serial interface.


Site Timeline