0
\$\begingroup\$

I am sending few data to the hyperterminal via UART. When i send a new line character, the data moves to the next line but it starts from the point where the previous data is stopped. The cursor doesn't move to the beginning of the line.I have tried many times using ASCII 10,11 and 13 and it still doesn't work.How do i fix this?

\$\endgroup\$
  • \$\begingroup\$ ASCII 13 (0x0A) should return to the start of the line, are you certain you sent it? \$\endgroup\$ – Jasen Apr 30 '17 at 12:15
  • 3
    \$\begingroup\$ @Jasen 13 != 10 \$\endgroup\$ – Oskar Skog Apr 30 '17 at 12:27
  • \$\begingroup\$ HA! I meant 0x0D \$\endgroup\$ – Jasen Apr 30 '17 at 12:33
  • 3
    \$\begingroup\$ Some terminal emulators have configuration options to allow different newline sequences. If Hyperterminal doesn't, one answer is to upgrade to one (e.g. PuTTY) that does. \$\endgroup\$ – Brian Drummond Apr 30 '17 at 13:37
  • \$\begingroup\$ you are sending 0x0A but not 0x0D. if this is a printf try /r/n instead of just /n \$\endgroup\$ – old_timer Apr 30 '17 at 14:02
5
\$\begingroup\$

Hyperterminal has not been included in Windows since pre-Win7 so it's pretty much deprecated. Most of us use some alternative(s) such as Putty, Realterm or Teraterm (all free downloads).

CR LF (in that order!) should do it (0x0D, 0x0A), but there is a setting in Hyperterm that allows you to automatically tack a LF on the end of a CR.

enter image description here

Other terminal programs will typically have a similar option- here is Realterm:

enter image description here

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ +1 for screencapturing Hyperterminal, and drawing arrows. Helps a bunch, thank you! \$\endgroup\$ – user2497 Apr 30 '17 at 23:22
3
\$\begingroup\$

Generally CR/LF should do the job.

CR is carriage return, with cursor going to the beginning of the same line.

LF is line feed, with cursor moving next line vertically (this is what you currently see on your terminal).

Send two characters one after another - 0x0d (13) and 0x0a (10).

Some applications will consider only LF to be new line indicator, but these applications are oriented for data flow rather than displaying this data on simple text devices like ASCII terminal.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.