Home

ROM Monitor Tests

Testing with a Serial-over-FTDI Module

Resources

Overview:

To test our ROM Monitor program, we'll use the configuration involving the 16550 UART. We won't be using the 8255 PPI which is currently configured for input from the keypad and output to an LCD panel.

 

Giving Credit Where It's Due:

Peter Murray of 39k.ca and I have greatly expanded Matthew Cook's Z80 monitor program from its original 3 commands to include many useful commands that can be seen in the right-adjacent panel. As of 2019/04/19, there are 11 different ROM Monitor commands.

The link to Peter's web site is to his newest project - the M62 Bus System he created. It's a modular Z80-based system that supports multiple cards, including expansion RAM or ROM, which are used to break the Z80 64KB  barrier; check it out.

 

Parts:

You'll need a terminal emulation program for your PC. Tera Term is simple and effective for our needs and is currently at version 4.1

Although the Serial-FTDI-RS232 schematic shows a 9-pin D-Sub connector for RS232 in the bottom left of the schematic, we're going to use the jumper block in the top center instead. You'll need an FTDI adaptor that converts USB signals from your PC to TTL-level serial signals needed by the UART: an  FTDI USB to TTL Serial adaptor or FTDI Basic Breakout module. The adaptor/module may be using the FT232RL chip or the less expensive CH340G chip.

With either of the FTDI driver chips, you're going to need drivers for the board for your PC's operating system. I have tested both of the chip driver links and they work fine.

Warning: although some of the FTDI-USB modules can support 5vDC, they still expect to see 3.3v on their signal lines. You can run them on 5v but don't expect them to last. A workaround would be inserting a CD74HC4050 driver chip between the module's DTR, TX, RX, and CTS lines and your system, but you'll also need a 3.3v regulator for the chip's power supply. An easier workaround is to do as I have done in the PCBs section of this website: use a resistor network to step down the voltage to tolerable levels. Here's a link to the schematic; the resistor network is on the right side of the schematic.

A mini USB or micro USB cable to connect your PC to the adaptor/module.

Before you order either USB-to-Serial adaptor/module, keep in mind that some are 5v, some are 3.3v, and some use a jumper to select between the two voltages.

 

USB to Serial Installation Guide:

Install the FTDI drivers, then install the adaptor/module when prompted by the PC operating system. Keep in mind there are two different FTDI chips out there as mentioned earlier, with the most common one from the off-shore boards being the CH340G chip.

Plug the 6-pin FTDI adaptor into your breadboard. Provide +5v and Gnd to it. The pins are most likely labeled, left to right:

DTR     RxD     TxD     Vcc     CTS     Gnd

You should connect these adaptor pins to the corresponding pins on your jumper block.

In the schematic in the adjacent panel you may have noticed that DTR and DSR are tied together, RTS and CTS are tied together, and RI and DCD are pulled to ground. The RS232 spec states that DTR/DSR are "I'm here" signals between the DTE (terminal) and DCE (modem) on the local side. (In typical serial communication, there is a corresponding arrangement on the remote side.)  Additionally, RTS/CTS are hardware flow control signals between DTE and DCE but these have often been replaced over time with in-stream flow control via XON and XOFF ASCII commands between local and remote ends. You may still see RTS/CTS flow control between DTE and DCE on the local side. And finally, RI (DCE) and DCD (DCE) relate to waking up the remote end of the "call" when establishing a link.

Vendors no longer seem to adhere to the original RS232 spec that I studied and implemented extensively while working at Gandalf Data Systems between '87 and '93. Vendors repurpose many of the RS232 control signals for own needs. For example, AutoReset is a feature that allows you to upload a compiled sketch to an Arduino board without pressing the reset switch. The way it works is by sending a reset signal (GND) to the reset pin using the DTR signal on the RS-232 interface.

NOTE: The 16550D UART Schematic has the oscillator pins mislabeled: GND should be 4 and VCC should be 8.

 

How do I test my circuit?

Ensure your Z80 system is running. Connect a USB cable between the serial FTDI module and your PC. Start up the terminal emulation software on your PC. Press your Z80's Reset button. This should display the opening screen with the monitor version and coding credits. In the PC terminal software screen, press the "?" key to get a list of ROM Monitor command; it should be the same as those shown in the right-adjacent panel. In the adjacent  panel there is also a link to a video that walks you through several of the ROM Monitor commands.

 

How do I get this program onto my EEPROM?

The 9600bpsROMmonitor.zip file contains the .asm assembly code file, a .lst file showing the machine code and assembly code, and an .obj file that contains just the machine code; the .obj file is in binary format. (Most EEPROM "burners" will support either a binary file or an Intel .hex file.) You will need to configure your terminal emulation software and port for 9600bps.

If you have not been following along up until now, it's time to consider buying a real EEPROM burner. Here's one that I have been using for about 12 months. It's easy to configure, easy to setup and use each time, and very reliable; it's a TL866 II Plus. Don't get the plain TL866 if you can afford the TL866 II Plus. I bought mine on eBay for $54.14us with free shipping, and it took 2 weeks to arrive from Shanghai CN. You'll also need the bag of converters if you plan to run any non-DIL chip in your project. An example would be the 16550 UART available in 44PLCC package that takes up a lot less room on your PCB. The adaptor means you can run the chip in your breadboard.

Eagle CAD: Serial-FTDI-RS232 Schematic

 

 

Tera Term VT Terminal Emulation Program

 

 

ROM Monitor Commands

 

 

Short Video: ROM Monitor Tests

Clicking the thumbnail gif above will provide an HD video (4.5MB, .mp4 format)

 

 

 

 

Testing with a Serial-over-Bluetooth Module

Resources

If you would prefer to connect to your Z80 system with serial-over-Bluetooth instead of serial-over-FTDI and a USB cable, add an extra female 1x6 connector to the circuit as shown in the schematic in the adjacent panel. You plug your serial Bluetooth module into your Z80 system instead of the serial FTDI module and you will be able to communicate with your Z80, providing you stay within about 10m. Communication appears to be limited by the vendor to 9600bps, 8 bits, No Parity, and 1 Stop Bit which is plenty fast for interactive work with the ROM Monitor. The vendor indicates you must adhere to the protocol of 8N1 but there is no mention of a speed limitation; you might want to try faster speeds. Don't forget to set the speed in the line 28 of UARTDriver_DON.asm, recompile with Assemble_DON.BAT, and then burn the resultant binary file Z80Monitor_DON.obj to EEPROM.

 

Here's a link to a cheap HC-06 serial BT module I tested that works well.

 

Installing Bluetooth:

First things first, remove the serial FTDI module so it does not cause grief with either the BT installation nor operation.
In Windows 10, click Start window | Settings gear | Devices | Bluetooth & other devices.
Turn Bluetooth on.
Physically install the BT device.
Click Add Bluetooth or other device at top, and choose Bluetooth.
HC-06 is the device you want to add: click it and it will show Connecting.
When prompted, enter the pairing PIN of 1234 and press Connect. The device will now show as Paired. Click Done and close the BT menu.

When the HC-06 is not paired, a red LED continually flashes. Once paired, it flashes twice every couple of seconds.

Many BT devices like this one are setup for moderate speed and dual comm ports. Let's configure it:
Go to Device Manager (right-click on This PC, choose Manage, choose Device Manager)
Under Device Manger, open Ports (COM & LPT).
You should see the following:
Communication Port (COM1) by default
USB Serial Port (COM4) that we setup on our FTDI modules if you forgot to remove it...
Standard Serial over Bluetooth link (COM9) and (COM 10) and maybe (COM11).
Note, if you already have other serial ports in use like an Arduino or whatever, your Com port numbers may not be the same as mine. It's probably best to check the number before you add the BT device.

Double-click each of the Bluetooth Com ports, choose Port Settings and ensure the comm is set to 9600 8 N 1.
Exit Device Manager.

Startup TeraTermVT and choose Setup followed by Serial Port. Go through the new com ports and ensure each is set to 9600 8 N 1. Click OK, then re-enter Setup and choose Save Setup.

Hit your Z80 system CPU Reset button, then hit the Enter key while in TeraTerm. If you don't get any response, navigate back to Setup | Serial Port, choose one of the other ports, and click OK. Don't be surprised if it happens to work on the highest port number that was added automatically when you installed the BT device. I don't know why this is but if I had to guess, I would say that one port is Send, one port is Receive, and one port is the virtual merging of the two. But that's just a guess. Don't forget that TeraTermVT will always show the active port in the upper left corner on the title bar.

 

Do you want to mess around with your new HC-06 serial-BT module?  Here's a link to check out.

Eagle CAD: Serial-Bluetooth-FTDI-RS232 Schematic

 

 

Device Manager| Ports config before adding BT device

 

 

Device Manager| Ports config after adding BT device

 

TOP

 

Home