VT-100 CONSOLE FOR HOMEBREW COMPUTERS
Posted: Tue Apr 28, 2020 11:13 pm
VT-100 CONSOLE FOR HOMEBREW COMPUTERS
Ever since I designed and built POC V1.0, I’ve used a serial-interfaced, "dumb" terminal as the system console. First it was a WYSE 60, then an ADDS 260LFC, and now a WYSE thin client in WYSE 350 emulation mode. These have all worked out well, but I have really wanted my computer to be a "stand-alone" unit not dependent on another computer or computer-like-device to operate.
Part of that goal was realized (more-or-less) in 2012 when I built a SCSI host adapter and thus was able to attach mass storage to POC V1.1. However, POC V1.1 and the units that followed were still dependent on a terminal for a console. I needed to devise something that would allow me to integrate display and keyboard I/O and thus break free of the bonds chaining me to a terminal. That started me on a long process of evaluating different approaches to video output and keyboard input.
An early step was to look at the Picasso video display module. I purchased one and played around with it a bit but for various technical reasons concluded it wasn’t suitable for my application. I gave it away.
Next, I looked at the MicroVGA unit, which drives a VGA monitor and accepts input from a standard PS/2 style keyboard. It mostly behaves as an MS-DOS ANSI.SYS console and based upon the information given on the MicroVGA website, I purchased one. It worked as advertised, but was not very satisfactory. It has a poor mechanical layout—the keyboard socket is jammed right up against the video receptacle, which is a problem with the Key Tronic keyboards I use (and sell)—and the character set’s font is horrid and for me, difficult to read. I still have it on my shelf collecting dust.
In late 2014, I became aware of an Australian gentleman, Geoff Graham, who had developed some interesting applications for Microchip’s PIC microcontroller (MCU), one of them being an ASCII terminal that implements most of the VT-100 command set, plus some graphics extensions. The hardware design is straightforward and uses only readily-available components. The only specialized device is the PIC PIC32MX250 MCU, which can be purchased with the requisite firmware already loaded.
At the time of this discovery, I was very busy with other (money-making) things, and hobby computer stuff languished. Finally, in the latter part of 2017 when things had slowed down, I decided to proceed and procured a bare PCB and flashed PIC. However, before the parts had arrived, I experienced a little medical malady that brought everything to a halt. The parts took up residence next to the MicroVGA unit.
Fast forward to late 2019 and now I was working on the design for POC V1.2, which was to serve as a guinea pig for testing some hardware concepts (Jeff’s clock stretcher being one of them). I decided now was the time to get the VT-100 terminal off the shelf and into operation. I completed its assembly yesterday and gave it a test. It works as advertised.
This unit is designed to be powered by a 5 volt source and driven by a serial interface running at TTL levels. Although the PIC and associated circuitry operate at 3.3 volts (there’s an on-board regulator to produce the 3.3 volts), the serial-in connection is 5 volt tolerant and in fact, could be directly connected to a TIA-232 level output without damage.
The terminal understands much of the VT-100 command set, and includes the cursor-addressing functions. Also included are the commands for clearing part or all of the display. Absent in firmware versions prior to V1.3 are the functions for turning off and turning on the cursor, which is not a deal-breaker for me.
In addition to character-oriented features, the terminal has pseudo-commands that can generate graphic lines, rectangles, circles and filled areas, all of which are plotted in terms of pixels from the 0,0 coordinate, which is the top, left corner of the display. Notably absent are the alternate characters that produce box drawing glyphs, such as ┤ or └. These will have to be simulated by using the graphics commands. Any use of the graphics features in assembly language will require four-function integer math, which is not too difficult to implement on the 65C02/65C816 (there is code around here that can be used).
As far as construction goes, purchasing a PCB instead of laying out one and having it made was a less-expensive and less-time-consuming route, and virtually eliminated the likelihood of a DOA unit due to a design defect. The unit required about three hours assembly time and worked on the first try.
On his website, Geoff has published the schematic, parts list and firmware for this gadget, which means it is possible to integrate the terminal into a larger design. I plan to do exactly that in a future iteration of my POC series, which will result in the unit truly being stand-alone. For now, POC V1.2 has its console channel arranged so I can patch the terminal in and test it under actual operating conditions.
Now for the interesting part. Geoff also released the source code for the PIC32, which I have studied in some detail out of curiosity, but also with a half-formed plan. Truth be known, I have never liked the VT-100/ANSI/ECMA48 control set. It’s a classic, design-by-committee mess and due to the general structure of the commands, e.g., <ESC> [<v>;<h>H to plot the cursor (<v> is the row and <h> is the column, both being 1-based), results in more serial I/O traffic than later and more modern command sets, such as that implemented by the WYSE 60/150/160/GPT/325 terminal series (in contrast, plotting the cursor on a WYSE unit is <ESC>=<v><h>, which is also assembly language-friendlier, since <h> and <v> are one-byte binary, not multiple ASCII numerals).
So, my eventual interest would be in replacing the VT-100 commands with their WYSE 60 equivalents. Not only will the terminal run faster because of the reduced workload (no ASCII-to-binary conversion needed), less flash memory will be needed to store the code, since the resulting command look-up table will be smaller and command parsing will be less complex. This latter has to do with fact that the actual command "word" is at the end of the sequence, e.g., H in the cursor plotting command, not the beginning as it is in the WYSE command set, necessitating that a command be parsed in reverse.
First thing though will be to integrate the terminal into a future version of POC V1.
————————————————————
EDIT: The MicroVGA website appears to be up again.
Ever since I designed and built POC V1.0, I’ve used a serial-interfaced, "dumb" terminal as the system console. First it was a WYSE 60, then an ADDS 260LFC, and now a WYSE thin client in WYSE 350 emulation mode. These have all worked out well, but I have really wanted my computer to be a "stand-alone" unit not dependent on another computer or computer-like-device to operate.
Part of that goal was realized (more-or-less) in 2012 when I built a SCSI host adapter and thus was able to attach mass storage to POC V1.1. However, POC V1.1 and the units that followed were still dependent on a terminal for a console. I needed to devise something that would allow me to integrate display and keyboard I/O and thus break free of the bonds chaining me to a terminal. That started me on a long process of evaluating different approaches to video output and keyboard input.
An early step was to look at the Picasso video display module. I purchased one and played around with it a bit but for various technical reasons concluded it wasn’t suitable for my application. I gave it away.
Next, I looked at the MicroVGA unit, which drives a VGA monitor and accepts input from a standard PS/2 style keyboard. It mostly behaves as an MS-DOS ANSI.SYS console and based upon the information given on the MicroVGA website, I purchased one. It worked as advertised, but was not very satisfactory. It has a poor mechanical layout—the keyboard socket is jammed right up against the video receptacle, which is a problem with the Key Tronic keyboards I use (and sell)—and the character set’s font is horrid and for me, difficult to read. I still have it on my shelf collecting dust.
In late 2014, I became aware of an Australian gentleman, Geoff Graham, who had developed some interesting applications for Microchip’s PIC microcontroller (MCU), one of them being an ASCII terminal that implements most of the VT-100 command set, plus some graphics extensions. The hardware design is straightforward and uses only readily-available components. The only specialized device is the PIC PIC32MX250 MCU, which can be purchased with the requisite firmware already loaded.
At the time of this discovery, I was very busy with other (money-making) things, and hobby computer stuff languished. Finally, in the latter part of 2017 when things had slowed down, I decided to proceed and procured a bare PCB and flashed PIC. However, before the parts had arrived, I experienced a little medical malady that brought everything to a halt. The parts took up residence next to the MicroVGA unit.
Fast forward to late 2019 and now I was working on the design for POC V1.2, which was to serve as a guinea pig for testing some hardware concepts (Jeff’s clock stretcher being one of them). I decided now was the time to get the VT-100 terminal off the shelf and into operation. I completed its assembly yesterday and gave it a test. It works as advertised.
This unit is designed to be powered by a 5 volt source and driven by a serial interface running at TTL levels. Although the PIC and associated circuitry operate at 3.3 volts (there’s an on-board regulator to produce the 3.3 volts), the serial-in connection is 5 volt tolerant and in fact, could be directly connected to a TIA-232 level output without damage.
The terminal understands much of the VT-100 command set, and includes the cursor-addressing functions. Also included are the commands for clearing part or all of the display. Absent in firmware versions prior to V1.3 are the functions for turning off and turning on the cursor, which is not a deal-breaker for me.
In addition to character-oriented features, the terminal has pseudo-commands that can generate graphic lines, rectangles, circles and filled areas, all of which are plotted in terms of pixels from the 0,0 coordinate, which is the top, left corner of the display. Notably absent are the alternate characters that produce box drawing glyphs, such as ┤ or └. These will have to be simulated by using the graphics commands. Any use of the graphics features in assembly language will require four-function integer math, which is not too difficult to implement on the 65C02/65C816 (there is code around here that can be used).
As far as construction goes, purchasing a PCB instead of laying out one and having it made was a less-expensive and less-time-consuming route, and virtually eliminated the likelihood of a DOA unit due to a design defect. The unit required about three hours assembly time and worked on the first try.
On his website, Geoff has published the schematic, parts list and firmware for this gadget, which means it is possible to integrate the terminal into a larger design. I plan to do exactly that in a future iteration of my POC series, which will result in the unit truly being stand-alone. For now, POC V1.2 has its console channel arranged so I can patch the terminal in and test it under actual operating conditions.
Now for the interesting part. Geoff also released the source code for the PIC32, which I have studied in some detail out of curiosity, but also with a half-formed plan. Truth be known, I have never liked the VT-100/ANSI/ECMA48 control set. It’s a classic, design-by-committee mess and due to the general structure of the commands, e.g., <ESC> [<v>;<h>H to plot the cursor (<v> is the row and <h> is the column, both being 1-based), results in more serial I/O traffic than later and more modern command sets, such as that implemented by the WYSE 60/150/160/GPT/325 terminal series (in contrast, plotting the cursor on a WYSE unit is <ESC>=<v><h>, which is also assembly language-friendlier, since <h> and <v> are one-byte binary, not multiple ASCII numerals).
So, my eventual interest would be in replacing the VT-100 commands with their WYSE 60 equivalents. Not only will the terminal run faster because of the reduced workload (no ASCII-to-binary conversion needed), less flash memory will be needed to store the code, since the resulting command look-up table will be smaller and command parsing will be less complex. This latter has to do with fact that the actual command "word" is at the end of the sequence, e.g., H in the cursor plotting command, not the beginning as it is in the WYSE command set, necessitating that a command be parsed in reverse.
First thing though will be to integrate the terminal into a future version of POC V1.
————————————————————
EDIT: The MicroVGA website appears to be up again.