RS-232 Stop Bits in Agilent Instruments

Turns out Agilent instruments do not use the same defaults for the RS-232 in their instruments.

54600 series uses 1 stop bits (most common):

RS-232 modules used in old 54600 series
54620/54640 series (newer 54600 series)

However other bench instruments such as power supplies (E3640 series 663X series) and 33120A arbitrary waveform generator uses 2 stop bits (fixed regardless of parity), which is usually NOT THE DEFAULT for most terminal clients:

E3640 series and 33120A’s RS-232 configuration.
Parity only trade away one data bit, so it does not affect stop bit
663X series powers supplies’ programming manual aren’t explicit about that except in code example

Loading

F#*@ing newline in Putty

I tried to use Putty to connect to my serial port test instrument (Agilent’s 33120A or E3600 series power supplies) and to my dismay it doesn’t respond to my commands.

I figured it might be newlines not being recognized properly. Checked the programming manuals and found that HP/Agilent accepts LF (‘\n’)as newline and optionally allowing a CR (‘\r’) before it (i.e. CR+LF like Windows).

I thought this configuration (Implicit LF in every CR) would work:

However it doesn’t! I had to dig through internet forums to find out that the ‘Terminal’ settings page controls what gets SPIT OUT TO THE TERMINAL SCREEN, not how your keystrokes are treated/sent! This page controls what your keystrokes mean:

However, it says nothing about what Putty does with ENTER key. I found from Stackflow that Putty sends out only CR (‘\r’) when ENTER key is pressed.

Turns out with terminals,

  • Ctrl+J is LF
  • Ctrl+M is CR,

and the convention for ENTER is Ctrl+M (also mentioned here):

https://ss64.com/bash/syntax-keyboard.html

So if you want ENTER/RETURN key to generate LF (instead of CR) with the official putty, you have to press Ctrl+J each time!

Putty sending CR (Ctrl+M) with ENTER key by default is also hinted by the default Telnet (only applies to telnet, not serial) setting in the Putty docs “Return key sends Telnet New Line instead of Ctrl+M”, which means outside Telnet, it the default behavior or ENTER/RETURN key is Ctrl+M (CR)!

Ironically even HyperTerminal came with the option to send out CR+LF on ENTER key! Luckily some kind soul (Grzegorz Niemirowski) compiled a mod (currently v0.74) which added the option and and posted it on Stack overflow:

Loading