* * HARDWARE OVERVIEW * *

The uTerm2-S (micro Term2 Stand-alone) is an easy to build multi-emulation RS232 terminal using an ESP32-Wroom-32 module and the great FabGL library (http://www.fabglib.org). More, using an ESP32 gives the opportunity to use the uTerm2-S in a lot of different ways easily using the Arduino IDE with the ESP32 core.

These the main specs of uTerm2-S:

In the following image a uTerm2-S (previous PCB revision) connected to a common PC speaker:

This one is the final board:


THE COM-USB2 (J3) CONNECTOR (TRANSPARENT PORT)

The uTerm2-S has a "transparent" port for an USB-serial adapter (as in the uTerm-S), so you can e.g. use XMODEM to exchange files with a PC (running a terminal emulator that supports XMODEM file transfer) while the uTerm2-S is in use.

Both the "mixed" power supply scenarios (USB-serial adapter not powered from USB but uTerm2-S powered and vice-versa) are managed by the HW, so you don't need to worry about it.

In the following photo a serial-USB adapter is connected with a cable to the transparent COM-USB2 (J3) port:

This allows to use two keyboards and two monitors in the "same" time (one keyboard and monitor attached directly to the uTerm2-S, and another keyboard and monitor of the terminal emulator on a PC connected with the serial-USB).

Please note that the COM-USB2 (J3) port supports the RTS/CTS HW handshaking, so both RTS/CTS signals are needed on the serial-USB adapter.

In the following image a common CP2102 based serial-USB adapter with the RTS/CTS signals connected:

The following table shows how to connect the serial-USB adapter to J3:


NOTE:
The signals assignment is the same of the SER-USB (J3) connector of the uTerm-S.


THE PRG-USB1 (J2) CONNECTOR (PROGRAMMING PORT)

The PRG-USB1 (J2) connector is use to program the ESP32 using a serial-USB adapter (it is recommended to use a model that supports the default 921600 bit/s upload speed, like the CP2102 based adapters).

Both the "mixed" power supply scenarios (USB-serial adapter not powered from USB but uTerm2-S powered and vice-versa) are managed by the HW, so you don't need to worry about it.

For more information about the programming procedure see the "HOW TO PROGRAM THE ESP32" paragraph.


THE SPK (J9) CONNECTOR

The SPK (J9) connector is used to attach an optional speaker (4/16 Ohm). I've used a salvaged PC speaker.


OTHER CONNECTORS

The remaining connectors are obvious. PS/2 KB (J5) and PS/2 MOUSE (J4) are for a PS/2 keyboard and an optional PS/2 mouse. Please note that many USB keyboards (and USB mouses too) have a PS/2 compatible chip inside so can be used with the well known "green adapter":


The VGA (J1) connector is for a VGA monitor, and the RS232 (J8) connector is the RS232 serial port for the Host. The maximum speed is 115200 bps (it is the maximum speed of the MAX232 RS232 driver).

The DC-IN (J2) is the power in connector. It is recommended to use a 9V 1A DC power supply.


THE RTS-HS (SW3) SWITCH

The uTerm2-S has both the RTS/CTS signals for HW handshaking between the RS232 serial port (J8) connector (for the Host) and the COM-USB2 (J3) connector (the "transparent port" for the terminal emulation SW on a PC), so it can be used for file exchange.

To clarify the following image shows a block diagram of the serial ports of the uTerm2-S:

On the COM-USB2 (J3) side the RTS signal is used by the terminal emulation SW on a PC to put in a wait state the communication if the RX buffer on the PC side is full. The CTS signal is an input that allows the Host to do the same if the input buffer on the Host side is full. Because a PC is typically a lot more fast than a retro-system it can be handy set the RTS signal to an "always ready to accept" state (on the PC side). In this case the RTS-HS switch (SW3) is used to turn on or off the RTS handshaking.

When turned off, the Host connected to the serial port will see the RST line always active (RTS and CTS are active "Low" signals). This can be handy in some situations.

The RTS-HS switch has no influence on the CTS signal.


THE RST KEY (SW2)

The RST key (SW2) is used to reset the ESP32 module.


THE DFLT KEY (SW1)

The DFLT key (SW1) is used to reset all the terminal parameters to default values. To activate this function you have to press down the DFLT key and, while holding it down until the reset is complete, press and release the RST key (SW2) to reset the uTerm2-S.


NOTE: the DFLT key must be enabled inside the AnsiTerminal sketch (see the "HOW TO PROGRAM THE ESP32 (J2/PROG-USB1 CONNECTOR)" paragraph) to make it work.


* * SOFTWARE OVERVIEW * *

The uTerm2-S is designed to use the FabGL library, so you need to install Arduino IDE and the ESP32 core at first.

Then you have to install the FabGL library. Because there are a lot of tutorials around I'll not give more details here (i.e. see the Demos and Tutorials section on the FabGL site) about how set up the "toolchain".


HOW TO PROGRAM THE ESP32


The uTerm2-S can be programmed using the Arduino IDE as a common ESP32 board (having the needed circuitry for auto uploading):

You just need to use the PRG-USB1 (J2) connector with a serial-USB adapter:

The following table shows how to connect the serial-USB adapter to PRG-USB1 (J2):


NOTE:
You can use the same adapter/cable for both programming (thru J2) and communicating with the transparent port (thru J3) as the J2 and J3 connection tables have a compatible signals assignment.


To flash the terminal FW you have to open the AnsiTerminal "sketch" from the Examples of the FabGL library:


Remember to change at first the line containing:

#define USERESETPIN 0

to:

#define USERESETPIN 1

 to enable the DFLT key:

Now you can compile and flash the AnsiTerminal sketch.


NOTE 1: Don't enable the HW RTS/CTS handshaking on the "Flow Control" terminal setting panel as the HW handshaking is reserved for the COM-USB2 (J3) "transparent" connector (see the "THE RTS-HS SWITCH" paragraph), and the relative GPIOs are not used for that.

NOTE 2: The maximum terminal serial speed cannot exceed 115200 bps.


GAMES

In the Examples directory of the FabGL library there are some games that can be run with the uTerm2-S too.

Here Space Invaders:

and Classic Racer:

and don't forget to connect the speaker!


* * uHAT ADD-ON BOARD * *

Just out of curiosity I've done a little add-on board with a PSRAM (specific for the ESP32) and a microSD socket. I've called it uHat (micro Hat) as it is fitted over the uTerm2-S board using the AUX (J6) connector like an hat:

The uHat  add-on allows to run an interesting application of the FabGL library that requires the SD and the PSRAM.


PC XT EMULATION

There is a FabGL library application (inside the FabGL library examples) that emulates a PC XT. There are a few options, but the most interesting is probably that one with Windows 3.0.

Because the SD on the uHat uses different GPIO, before compiling the PCEmulator.ino application you have to change the parameters at the line containing the "FileBrowser::mountSDCard" call as shown in the following image (yellow line):

And here the emulator in action:


Z80-MBC2 EMULATION

Tanks to Michel Bernard the Z80-MBC2 can be completely emulated with the uTerm2-S + uHat (this emulator is based on the FabGL lib too). You have to use the same SD of the real one. The User key of the Z80-MBC2 here is emulated with the DFLT key.

In the Files section I've uploaded the ready to use version for the uTerm2-S (changes for the uTerm2-S + uHat are marked with the "J4F:" string inside comments):


WHERE TO GET A PCB

I've prepared an "easy" link to get a small lot (5 pcs minimum) of the uHat PCB. The link is this one.


* * WHERE TO GET A PCB * *

I've prepared an "easy" link to get a small lot (5 pcs minimum) of the uTerm2-S PCB. The link is this one.


* * HOW TO GET A KIT OR AN ASSEMBLED UNIT * *

If you are looking for a kit with all the needed parts or an assembled unit ready to use now there is a professional seller that can sell both and ship worldwide.

The link to the seller is this one.


* * USERS GROUP * *

An "Users Group" was created on Facebook (it is the same used for the Z80-MBC2): https://www.facebook.com/groups/388307645238660/


* * LICENSING AND CREDITS * *

The FabGL library was developed by Fabrizio Di Vittorio (http://www.fabglib.org).

The Z80-MBC2 emulator was developed by Michel Bernard.

All the project files are licensed under GPL v3.

If you use this material in any way a reference to the author (me ☻) will be appreciated.