Problem in showing numbers in Hayperterminal

Discussion in 'The Projects Forum' started by eric_s88, Apr 12, 2013.

  1. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    Hi everyone!

    I want to send a float number ( 18.8 for example ) with atmega8 usart to hayperterminal ( through a USBtoTTL converter module ).

    I use ftoa() function in stdlib.h library to convert float number to a string, and use puts() function to send this string..

    the written code send the number every 1000ms and output is like this:
    18.8
    18.8
    18.8
    .
    .
    but I want the out put to be like this:
    18.8

    I mean I want the new line be overwritten on the previous line.

    the following code didn't help also:

    while(1)
    {
    ftoa(number,1,string);
    puts(string);
    putchar(13); // the ascii code that bring the curser to the first of line
    delay_ms(1000);
    }

    ascii code "13" supposed to be like above explanation, but after receiving the data it automatically goes to the next line and do the 13 code in the new line , not in the same line!
     
  2. BReeves

    Member

    Nov 24, 2012
    412
    64
    Something is appending a line feed character to the string you are sending or you have hiperterm set to append a line feed.
     
  3. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    thank you ;-)

    but I tried to change every available setting in CodeVisionAvr terminal, but it didn't help, I want to read temperature from a sensor and send its data to pc and see only one number that changes.. not like this:
    18.8
    18.8
    18.8
    .
    .
    .

    do you know another terminal program expect Hayperterminal and Codevision terminal ??
     
  4. ifixit

    Distinguished Member

    Nov 20, 2008
    638
    108
    Just to be sure...
    1. Use Hyperterminal
    2. Click on File, then goto Properties
    3. Click on Settings tab
    4. Click on ASCII Setup...
    5. Ensure that Append line feeds to incoming ends is unchecked.
    Good Luck,
    Ifixit
     
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    If you send a <CR> before every new data. The cursor should jump back to start. But by doing this. I think you must pad the string so all number strings has the same length
     
  6. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Send the ANSI "goto y,x" sequence before sending your numeric characters;

    goto y,x = <esc><"\"><"YY"><";"><"XX"><"f">

    where YY and XX are ASCII numbers ranging from "00" to "23" and "00" to "79" for the Y and X coordinates, respectively.

    Good luck on your project.

    Cheerful regards, Mike
     
  7. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    TeraTerm took the place ofhyperterminal for use as my terminal program a while back. Much better program, and free!

    Some terminal configurations will append a new line to each received line, or interpret the carriage return as both carriage return and new line. You need to make sure the configuration is appropriate for what you are trying to do.
     
Loading...