Thursday, February 9, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 6: Let's talk terminals

The Z80-MBC2 experience is the similar to using a MITS Altair, or SWTPC from the 1970's in that it uses a serial connection to interact with the outside world.  In the early days of computing, a separate "computer terminal" would be used to connect a keyboard and screen to your computer.  

If you have a vintage terminal in your collection, you can connect it to your z80-MBC2 using an inexpensive RS232 to TTL Serial Module.  This will provide your SBC with an old fashion serial port to which a standard terminal can connect.  

In chapter 4, I demonstrated using the Putty software to use your existing desktop PC as the terminal.  Putty provides a simple VT100/ANSI terminal connection over the USB-to-serial device allowing you to use your PC's screen and keyboard as the terminal interface for your new SBC.

Putty's default screen size is 80x24, faithfully replicating the screen size of many vintage terminals.  Because it supports both VT100 and ANSI sequences, both classic screen controls and color are supported.   Naturally, you can use your mouse to stretch the Putty terminal window to additional rows and columns.

Personally, I'm a fan of having a dedicated terminal, but without the bulky computer terminals of yesteryear.   This new terminal comes in two parts, ESP32 hardware and open source software.

The hardware part certainly won't break the bank.   I'm using a LILYGO® TTGO VGA VGA32 Module v1.4 from Aliexpress.  I noticed that there are several listed on Amazon, but they seem to be an earlier version of the board.   This $14 device acts as a dedicated computer terminal with TTL level serial, PS2 Keyboard/Mouse connectors, and VGA output.   There are a couple other features like Wifi and onboard SD connection, but I haven't taken advantage of them.  (yet)

The open source software comes in the form of an example program called Ansi Terminal which is part of the FabGL project.  This terminal supports multiple screen resolutions and even color graphics (more on this later).  You can use the same Arduino IDE you used to program the ATMEL32 to install the Ansi Terminal on your VGA32 module.  (Just make sure to change your board to ESP Dev Module.)

Special Note:  The ESP32 is a 3v device.   The Z80-MBC2 is a 5v device.   There is much debate online about the ESP32 possibly taking damage from being connected to a 5v device such as the Z80-MBC2.  Teo Swee Ann, who is CEO of Espressif Systems officially makes the statement on Facebook that the ESP32 is 5v tolerant on the GPIO pins, but cautions against powering it with 5v.  I've connected my own ESP32 devices to 5v interfaces for months at a time, but if you are concerned about potential damage, there are level shifters you can introduce to the circuit.   At the very least a small resistor can also be used on the input GPIO of the VGA32 module.  Myself, I'm not really worried about burning out a $14 part over a what appears to be years.   Your millage may vary....... yada, yada....

The VGA32 suffers from one minor "cheap China" issue, the silkscreen on the top of the unit is incorrect.  In fact, it's backwards.   Here the correct hookup for connecting the VGA32 to your Z80-MBC2.


If like myself, you are already powering the Z80-MBC2 using the USB-to-serial adapter, you are already using the VCC/GND connections on your SBC.  I've tied the GND line from the VGA32 to the now unused ground pin of the ICSP programming connection.  In a pinch there are also ground connections on both the IOEXP and GPIO sections as well.

Upload the Ansi Terminal for the VGA32 and set the baud rate for 115200 using F12 on your keyboard to access it's menu and you are good to go.



At some point, I'll be installing both the Z80-MBC2 and the VGA32 into a project box so that it becomes a mini computer, but for the moment I'm powering both devices from a dual jack USB wall wart.  Neither of these devices use much current and a battery system in in the plan as well for portability.

At this stage, we have a Z80 computer running CP/M with potential for 64 color graphics and sprites.   I'll get into the details in the next chapter.

 

My Z80-MBC2 and VGA32 Module Setup.





No comments: