1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Rewriting putchar() on MSP430F149

Discussion in 'Embedded' started by ispe, Jan 14, 2005.

  1. ispe

    ispe Guest

    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?
    ispe, Jan 14, 2005
    1. Advertisements

  2. ispe

    Joseph Casey Guest

    I use uprintf() which sends output one character at a time to a
    designated function. In my case the designated function is one I wrote
    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.

    Joseph Casey, Jan 15, 2005
    1. Advertisements

  3. 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 ;-)

    Jan-Hinnerk Reichert, Jan 17, 2005
  4. ispe

    ian_okey Guest

    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.

    ian_okey, Jan 18, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.