VT220 Serial Console Notes

DB25 β†’ DB9, 9600 8N1, ttyUSB0

vt220

A VT220 is just an RS-232 endpoint. The β€œmystery” is always cable topology or framing. These are my notes from getting it to behave as a Linux serial console.

Setup

  • VT220: DB25
  • Host: Linux + USB-to-RS-232 (ttyUSB0)
  • Default framing I used: 9600 8N1
  • Unit: VT220-A2 (white phosphor)

setup menu

VT220 variants

models

  • Mine: VT220-A2 β€” white phosphor.
  • VT220 shipped with multiple screen/phosphor variants and a large ecosystem of options (keyboards, host modules, serial/printer cabling).

Inside

inside-1

inside-2

ports

Signal reality

RS-232 idle sits at negative voltage. If I see 0–3.3V idle, I’m not on RS-232.

Scope
MODE
|
TEST
FRAME
|
BYTE
0xA5
TX
RX
STDATA

Cable topology

Two DTEs β†’ cross TX/RX (null-modem) and share ground.

  • DB25 2 β†’ DB9 2
  • DB25 3 β†’ DB9 3
  • DB25 7 ↔ DB9 5

Framing

Framing
byte
0xA5
8N1
0101001011
7E1
0101001011
7O1
0101001001

Bring-up

I start by proving the adapter and cable with minicom, then switch to getty.

  • device: /dev/ttyUSB0
  • framing: 9600 8N1
  • flow control: off (until I see real overruns)

Getty

I ended up with serial-getty@ttyUSB0 and forced 9600 + TERM=vt220.

Control sequences

These are the ones I actually use when driving the VT220 as a display. ESC means \x1b.

Reset / clear (my default)

  • reset attrs: ESC[0m
  • normal video: ESC[?5l
  • cursor off/on: ESC[?25l / ESC[?25h
  • clear screen + home: ESC[2J + ESC[H

This is exactly what ~/Workspace/termino/tools/serial_run.py and serial_panel.py send on startup:

  • ESC[0m ESC[?5l ESC[?25l ESC[2J ESC[H

Cursor + line ops

  • CUP (cursor position): ESC[{r};{c}H
  • EL (erase in line): ESC[K

(See serial_panel.py: it updates only changed lines via CUP+EL.)

SGR (style)

  • reset: ESC[0m
  • bold: ESC[1m
  • underline: ESC[4m
  • blink: ESC[5m
  • inverse: ESC[7m

Big text (DEC/VT100-style)

  • double-height (top/bottom): ESC#3 / ESC#4
  • double-width: ESC#6
  • normal size: ESC#5
Seq preview
SEQ
24Γ—80
\\x1b[0m\\x1b[2J\\x1b[H

References