2

I have PuTTY hooked up to a serial port and am reading an output of an AVR.

I send print command like this:

printf("OCR1A: %d \n", OCR1A);

And PuTTY does go to the next line but does not reset the column. Shown hereenter image description here

How can I have PuTTY start the newline column at zero instead 1 + current cursor position?

  • 1
    Can you send a carriage return line feed (\r\n) instead of just a new line? – heavyd Oct 4 '13 at 18:08
  • If the remote system is some flavor of Unix, an stty setting should fix that. I think it's stty onlcr. – garyjohn Oct 4 '13 at 18:23
  • @garyjohn i'm working with an AVR through serial tx and rx lines. – Nick Oct 4 '13 at 18:26
8

Enable the "Implicit CR in every LF" option.

| improve this answer | |
  • Changing it to this gave me garbage charters. The USART communcation I don't think like it. – Nick Oct 4 '13 at 18:13
  • It's 2017, and like minicom, this only applies for the output, and just adds extra noise. – mckenzm Sep 23 '17 at 21:24
  • This didn't make any difference at all for me. – Owl Oct 2 '18 at 14:19
4

Putty Doesn't transmit \n, regardless of option settings.

Using Tera Term (open source, windows or linux), you can easily terminate transmissions with \n, \n\r, \r or Auto.

| improve this answer | |
  • +1 for providing a decent alternative to PuTTy for serial use – Gabriel Staples Jan 23 '18 at 2:36
  • Cancel that; -1; Tera Term doesn't run in Linux. – Gabriel Staples Jan 23 '18 at 20:29
1

I needed a carriage return as well as a new line character.

printf("Hello world\r\n");
| improve this answer | |

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.