Sunday, February 12, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 7: FabGL AnsiTerminal & Microsoft BASIC

It's high time to explore the capabilities of the Z80-MBC2. By pairing it with the LILYGO TTGO VGA32 module, we have created a formidable 128K computer that can run CP/M with a variety of programming languages, including BASIC, PASCAL, C, and Assembly. This setup offers multiple video resolutions and up to 64 colors, as well as sprite support.

To get started, Microsoft BASIC (MBASIC-80), is readily available on the A> disk of the CP/M3 disk set. Interestingly, there are actually two variations of the BASIC interpreter to choose from.

MBASIC-80 V5.21 released in 1980. MBASIC-85 V5.29 released in 1985.

I tend to use slightly newer 85 version.

These were released when Bill Gates was still a programmer at Microsoft.

 

Also included in the same disk image is a copy the classic Star Trek game.

Star Trek is a classic example of what you can achieve with MBASIC and holds historical significance as a widely-circulated game during the early days of personal computing. To try it out for yourself, simply type "MBASIC TREKINST.BAS" at the A> prompt.

The TREKINST.BAS program provides instructions on how to play the game, where you assume the role of the captain of the USS ENTERPRISE and defend the Federation against the Klingons.

While the game was designed for early, single-color VT-100 terminals, our Z80-MBC2 computer with the VGA32 Module has much greater video capabilities. To make the most of this, I've enhanced the FabGL Ansi Terminal software to allow for control over screen resolution and font selection directly from the Z80-MBC2. Additionally, a 320x200 64-color video mode option is available.

You can download this tweaked version of Ansi Terminal from my GITHUB.

    https://github.com/eightbitswide/FabGL-AnsiTerminal-Mods-

This GITHUB package is a complete fork of Fabrizio Di Vittorio's FabGL project, with the majority of the modifications being made to the Ansi Terminal software. I have also incorporated the classic Commodore PETSCII font style into the VGA8X8 font.

It is assumed going forward that you have this version of the Ansi Terminal software installed on your VGA32 Module. Simply connect a PS2 keyboard, press F12, and you will have the ability to choose your options via a PS2 mouse or by using the TAB key to navigate between selections.

 

Choose your desired Resolution and Font setting and press F10 to apply it. Personally, I prefer the 512x354, 64-color option for most of my programming on the Z80-MBC2, which provides an ANSI/VT100 terminal with a screen size of 64x45 characters. Be sure to also check out the "Terminal Type" options, as Ansi Terminal can emulate various types of terminals, including Osborne, Kaypro, Hazeline, and ADM. If you need to make any changes to your terminal settings later on, simply press F12 and make your selections. Additionally, you can reset the screen without affecting the Z80-MBC2 by pressing CTRL+ESC from the same menu.

With this in place, let's take advantage of a few of those new graphics commands:

In the first example, you might have noticed that when Star Trek ran, the game cleared the screen, homed the cursor then welcomed us to the same with a moving ASCII art version of the USS Enterprise.   This was accomplished using VT-100 commands.

For example, if I want to clear the screen I would send [ESC]+[2J  to the terminal.  In BASIC this would look like:

10 PRINT CHR$(27)+"[2J";

Next if I want to home the cursor in the top left of the screen, I would send [ESC]+[H to the terminal.   Our BASIC program would get an additional line 20.

20 PRINT CHR$(27)+"[H";

Running the BASIC program with these two VT-100 commands will both clear the screen and home the cursor.   A complete list of VT-100 commands can be found on this website.  Ansi Terminal supports most of these commands.  This gives it the ability to be compatible with programs like Word Star.

Our terminal also supports some "non-standard" ESC commands as well.   Consider this: ESC "_GRECT" X1 ";" Y1 ";" X2 ";" Y2 "$"  This special graphics command will tell Ansi Terminal to draw a rectangle on the screen.   At the following line to your BASIC program:

30 PRINT CHR$(27)+"_GRECT10;10;150;150$";

With a single line of code we told the terminal to draw a box with the top left corner located at 10,10 and the bottom right corner located at 150,150.

In addition to the _GRECT command there are also _GPEN, _GLINE, _GPIXEL, _GELLIPSE as well as a variety of other non-standard ESC commands we can send our terminal.

A complete list of these commands can be found at the FabGL Specific Terminal Sequences page.


By utilizing these commands and some mathematical calculations, we can unlock a variety of intriguing graphics capabilities right away.

In the March 1981 issue of Compute Magazine, there was an advertisement for a  memory add-on for the Commodore PET computer. A demonstration program was included at the bottom of the advertisement.

Thanks to Tom Lake and John Galt (Altair-Duino: Google Groups) a version of this BASIC program has been adapted for use with those FabGL non-standard terminal sequences.

This TLHAT1.BAS program takes advantage of the _GPEN and _GPIXEL commands to draw what looks like a Fedora hat pixel, by pixel.

Let's review:

Ansi Terminal is capable of:

 

Let's see what those additional tweaks do:

Fedora Hat demo

Consider the following BASIC program:

  • 10 PRINT CHR$(27)+"_#320x200x64$"
  • 20 PRINT CHR$(27)+"_#LCD 8x14$"
  • 30 PRINT CHR$(27)+"_#APPLYSETTINGS$"
  • 40 FOR X = 1 TO 3000 : NEXT X
  • 50 PRINT "HELLO WORLD";

This simple BASIC program adjusts the resolution and font, applies the changes to the terminal, waits for the screen to update, and finally displays the message "HELLO WORLD" using an LCD font.

All of the available resolution and font options are listed on the GITHUB readme for FabGL-Ansiterminal-Mods.

Remember if you need to switch your terminal back to your preferred settings, press F12, make your changes, then F10 to save and reset.

A disk image containing a number of BASIC demos can be downloaded and extracted to your Z80-MBC2 SD card.  It replaces the normally empty P:> disk (file:D2N15.DSK) in CP/M3.  Launch P:>MBASIC85 {filename.bas}.  These demos are best viewed at 640x480x16.

These BASIC demos are intended to get you started in experimenting with the extended graphics commands.  If you come up with some additional ideas, please post them in the comments section.

 

Basic Sphere Demo


16 color Mandelbrot Demo

Fedora Hat Demo drawn in random pixel colors



 


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.





Sunday, February 5, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 5: Time to build your library.

Remember back in chapter 2 when I said that retro computers came with fairly comprehensive books and schematics allowing you to to master the entire system?  It's time to build your library.  

I'm linking to various PDF documents.  You can still obtain some of these in actual book form from Thriftbooks and Amazon.  (Remember when Amazon was just an online bookstore?) 

 

CP/M 2.2 and CP/M 3.0 Operating System Manuals:

 

Languages: Microsoft BASIC, Turbo Pascal, and HI-TECH C:


Word Star v3.3 and v4.0 Reference Manuals:


Schematics:

Saturday, February 4, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 4: Programming & First Boot on the Z80-MBC2

(Note: this page is currently under development and may be incomplete.)

This blog entry will lean heavy on various links which together have well documented these initial steps in the process.  There is no reason to recreate the wheel for this part so I'll be linking to all of the best materials already online. I would encourage you to go old school and create a 3-ring binder for this project.

Remember that "10 Pin Convert to Standard 6 Pin Adapter Board+USBASP USBISP AVR Programmer USB." I mentioned that you would want to obtain in chapter 3?  It's time to use it to program the ATMEL32 microcontroller.

 


The ATMEL32 microcontroller acts as both EEPROM and I/O emulator. It will need to be programmed with a bootloader before the Sketch can be applied.

https://hackaday.io/project/159973-z80-mbc2-a-4-ics-homebrew-z80-computer/log/150087-how-use-the-icsp-port-with-the-usbasp-programmer-under-linux-to-burn-the-bootloader 

Preparing the ATMEL32 is a two step process.  First you'll install the bootloader (using the ICSP connection), then install the sketch (using the serial to TTL connection) that makes everything work.  Using the information in the link.  I jumpered wires from the USB programmer to the ICSP pins on the Z80-MCB2.  The instructions are written for Linux users, but are 99% applicable to Windows users as well.   Make sure that the SD and RTC adapter are unplugged while using the ICSP pins.

You will need the Arduino IDE (I used the legacy version 1.18.9) and The sketch for the IOS (with the needed libraries). Unzip into a folder and open the .ino file (with Arduino IDE). IOS must be uploaded into the Atmega32A flash. 

I would also encourage you to add the following information to your binder. 

Once you've install the bootloader and sketch to the Z80-MBC, you can power up the Z80-MBC2 without the SD and RTC adapter using the serial to TTL adapter.  

The following connections between the adapter and the Z80-MBC2 are:

  • Adapter 5v to Z80-MBC2 VCC
  • Adapter GND to Z80-MBC2 GND
  • Adapter RX to Z80-MBC2 RX
  • Adapter TX to Z80-MBC2 TX

Download Putty (Linux & Windows versions available.)  Putty will act as your terminal to the Z80-MBC2 until we replace it with a dedicated terminal.   Set the serial line to match the serial port your serial to TTL device is installed to (Example: Windows COM1, COM2, COM3, etc -  Linux /dev/ttyACM1, /dev/ttyUSB0) and the baud rate to 115200.   Hit the Open button in Putty, then press the RESET switch on the MBC2.   You should see a screen that looks something like this:


At this point we aren't worried about the specifics, just the fact that we have understandable text demonstrates that things are starting to work and communication is happening.

If you get nothing at all, double check the connections between the serial to TTL adapter and the MBC2, your COM port and baud rate settings.   You can troubleshoot the connectivity on the Putty side by unplugging the RX and TX pins from the Z80-MBC2 and jumper them together with a piece of wire.   This will create a "Loopback Test" in which anything you type into Putty will be echoed back to the terminal.  Once you see that is working, reconnect RX and TX to the Z80-MBC2 and double check all of your solder connections, making sure each chip is seated properly without bent pins.

Before plugging in the SD card and RTC adapter.  It's important to make a modification to the RTC adapter before using it.  

The SD module (left) and RTC module (right)

Next to the topside SCL connection, there is a surface mounted resistor that needs to be removed.  This resistor can cause a battery meltdown and perhaps even damage.  I used the "brute force" method and removed it with my clippers.  

 

SD and RTC modules inserted correctly.

It is possible to plug these cards in the wrong direction.  Make sure the battery side of the RTC module faces toward the GPIO pins, and the SD card faces toward it's activity LED.  Both cards will insert in the PCB on the right side of their pins.

If you haven't downloaded the disk files for your SD card, now is a good time to do so.  Download and extra the file SD-S220718-R240620-v1.zip  It contains the content of the microSD needed to run CP/M 2.2, CP/M 3.0, QP/M 2.71, UCSD Pascal and Collapse OS.

You'll also want to download CpmtoolsGUI and this diskdefs file. I've found it easiest to simply copy both files to the SD card with the disk files.

Again, there is some excellent documentation (courtesy: land-boards.com) on CpmtoolsGUI already posted.  Their are also listings for the software on the disk images.  I'd recommend adding the entire page to your binder.

At this point you should be able to replicate the following video:

 


Once you install the SD and RTC modules, holding the USER button while pressing reset will present you with the following options:

0: No Change
1: Basic
2: Forth
3: Load OS from Disk Set (Current Setting)
4: Autoboot
5: iLoad
6: Change Z80 Clock speed (-->Option to switch to)
7: Toggle CP/M Autoexec (-->Option to switch to)
8: Change the Disk Set
9: Change the RTC time/data

If you look above in the top section of my screenshot, You see that I have my Z80 clocked at 8Mhz, My CP/M Autoexec is ON, I have the GPIO chip installed, my RTC modules was detected and my room is a rather warm 73f.

There are several disk sets you can choose from option 8.  Mine is currently set on CP/M 3.3.  I'd start with option 9, and set your time/date.  After which a quick jump into option 1, BASIC will allow you to program an obligatory HELLO WORLD program to officially declare your Z80-MBC2 working.

Use option 8, to change your Disk Set.  I'd recommend CP/M 3.3.

 

These are four highly recommended websites at this stage:

 

Z80-MBC2 Hackaday Project Homepage:

https://hackaday.io/project/159973-z80-mbc2-a-4-ics-homebrew-z80-computer

 

Just for Fun: Z80-MBC2 Homepage:

https://j4f.info/z80-mbc2

 

Land Boards: Z80-MBC2 Build Notes

http://land-boards.com/blwiki/index.php?title=Z80-MBC2_Build_Notes


Z80-MBC2 Usergroup Facebook Page

https://www.facebook.com/groups/Z80MBC2



 

Friday, February 3, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 3: Building the Z80-MBC2

Before we begin, I'll assume that you have gathered the parts required using the Z80-MBC2 "Build of Materials" worksheet.   All of the requirements and files can be found here.

The chips required for this build are:

  • Z84C0008 (CMOS) Z80 CPU.
  • ATMEGA32A-PU
  • TC551001-70
  • 74HC00
  • MCP23017 

The Z80, ATMEGA32A, and TC551001 can be sourced from distributors like Digikey, or your favorite supplier.  I sourced the MCP23017, 74HC00 and all of the other sockets, resistors, leds, etc. from Tayda Electronics.   The "Micro SD TF Card Storage Adapter Board",  "DS3231 IIC Module Precision Real Time Clock" and "USB to TTL Serial Port Module CH340N" are easy to find on Ebay.  The board gerbers are provided for those who are comfortable with having a batch made from PCBway or JLCPBC, but you will also find sellers on Ebay who are selling the bare PCB for less than $10.  Tindi has complete or partial kits from various sellers on and off.

While you are browsing Ebay for the serial-to-TTL, SD, and RTC modules, I'd also order a "10 Pin Convert to Standard 6 Pin Adapter Board+USBASP USBISP AVR Programmer USB."  This two piece kit will be used for loading the required sketch to the Atmega32 chip.

You can skip the MCP23017 chip, socket, and pin headers if you are not interested in GPIO, but I'd recommend building it.   This tutorial will demonstrate projects which uses the GPIO pins.

I've substituted the Z80 chip for the 10Mhz variety I had already in the shop, and they work fine.   It still runs at 4mhz or 8mhz, as dictated by the Atmega32 microcontroller.

I'd recommend printing off a copy of the Build of Materials and the PCB Front Reference for use as you assemble this project.  These will be your reference documents for where parts go and what they are.  This guide will assume that you have basic understanding of soldering and that perhaps you may have built one or two other projects.   

A special note concerning the build order:

The presented build order is my personal preference, but feel free to modify it. Installing components from smallest to largest can simplify the process. For instance, starting with resistors and diodes (Steps 5 and 6) before moving on to larger components can reduce difficulty during assembly. My approach is to begin with sockets and headers as I find it easier to secure them to the PCB with tape while soldering.

Got your parts?   Warm up the soldering iron and let's get busy.

1.  Start with the sockets first.

Insert the five sockets, making note that the notches in the socket itself are facing the same direction as the silkscreen notches.   If you get them backwards, they will still work, but may be confusing when you install chips later.   I tend to tape them down with a will electrical tape, then solder only 1 pin on each side to make sure they are completely seated before soldering the rest of the pins.  If a socket is sticking up, it's easy to heat up one pin while pushing back against the PCB.
 




2. Solder in all of the pins and headers:


Instead of installing the recommended JST_XH 02 (AUX Power) and IDC_PCB (ICSP) connectors, I opted to use straight pins. The listed connectors in the BOM are ideal due to their keyed plastic, which prevents incorrect insertion, but if you're paying attention, straight pins will suffice. For the GPIO, I used two single-row connectors that sit next to each other. If desired, female headers in the GPIO can also be used for a more Arduino-like setup.

When installing headers, a useful technique is to solder one pin and then check the alignment of the headers and pins to ensure they are straight.  This makes it easier to heat them with the soldering iron and realign them if necessary. It is crucial that the GPIO and ICSP pins are properly aligned and straight.


3. Install the SIP resistors between the sockets.

Pay special attention here.  These resistors are designed to work in one direction.  On the SIP resistor there is a dot which indicates the orientation.  This dot needs to match up with the square hole on the board.   Note: These resistors face different directions on this project.


4. install the two 2N2907 transistors:

Make sure to orient the components correctly. Follow the silkscreen markings on the board and position the flat side facing forward. Be careful when soldering these as the connections on the back are close together and can easily be connected by excess solder. If this occurs, don't worry, simply use a small amount of solder wick to remove the excess.  Avoid overheating the wick, as this can harm the transistors. If using solder wick, use it sparingly and with a brief touches of the iron to prevent damage to the part.


5. Install the Diodes:


There are two types of diodes used in this build, both of which have a line or stripe on one side. Ensure that this stripe aligns with the corresponding stripe on the silkscreen, as it indicates the diode's polarity. Diodes are like one-way streets, allowing current to flow in only one direction. If they are installed incorrectly, they may block signals from reaching their intended connections.


6 Install the resistors:

Resistors have no polarity, so they can be installed in any direction. They are marked with colored stripes that indicate their values. The first two stripes indicate numeric values, the third stripe is a multiplier, and the fourth stripe represents tolerance. Make sure to take your time and refer to the BOM sheet for each type of resistor. A neat and organized installation, with the tolerance stripes aligned in the same direction, is a bonus.

If you need to double check the value of your resistors, Digikey has an excellent resistor color code calculator.


7. Install the 22pf & 0.1uf capacitors, and the crystal:

There are three types of capacitors in this build.  The two 22pf caps are nearest to the crystal.  This is a good time to install the crystal as well.  The 0.1uf caps are scattered around the board.   These caps can be installed in any direction.  

8. Install the LEDs:

Just like the other diodes, the LEDs do have polarity and must be installed in the correct direction.  The shorter leg of the LED is the negative side.  Install it in the LED position with the shorter leg going into the square on the PCB.   In my own build I substituted the white LEDs for orange with good result.   The blue LED cannot be substituted.  There is a chance that the USER button will not function correctly without a blue LED in this position.

 

9 Install the two 100uf electrolytic capacitors:


 Just like the diodes, these two capacitors have a negative and positive side.  The negative side of the capacitor is well marked on the package and the positive side of each position also has a + sign on the PCB.   This is also a good time to install the two tact switches at the front of the board.


 10.  Install the chips!!!!

It's so exciting, you are almost done, but SLOW DOWN at this step.  New chips tend to have their pins splayed apart a bit more than the socket, so I gently hold the chip at an angle against my desk and give them a very gentle push to move the each side of the pins inward just a little bit.  Chips which are recycled can have very weak pins subject to bending as you insert them into the socket.   Line up the chips with those notches we talked about earlier and GENTLY insert them evenly into the sockets.  If you see a pin starting to bend, carefully remove the chip, straighten the pin and try again.


11. Clean up the solder flux from the bottom of the board.

You probably have a mess of soldering flux on the bottom of your board.  This needs to be removed as it will cause damage over a long time.  Use isopropyl alcohol (70% or greater) and a clean toothbrush or two to get the board clean.  Also use a lint-free rag to wipe the flux clean.   Electronics cleaners can also be used, with the end result of getting things clean.  At the same time review your soldering connections under a magnifier to locate any missed connections or cold (dull grey) solder connections.

 

Next, we'll discuss programming the Atmega32 and booting it up...

 





Thursday, February 2, 2023

Exploring the Z80-MBC2 Soup to Nuts Chapter 2: Introduction & Motivation

Before we start to dig into the assembly, software, and various projects involved with the Z80-MBC2 single board computer, I thought I'd give you a little background on the author and the motivation behind the creation of project documentation for this kit.

I'm a part of what is commonly called, Generation-X.  Born in the early 70's, before smartphones, Internet, and cable TV.   My earliest memories of experimenting with electronics as a child were lighting up 12v lamps salvaged from junkyards with the power supply from an old television.  When the home computer revolution started happening in the late 70's and early 80's, a Commodore 64 became my magic carpet to adventures in programming, telecommunication with BBS systems, and of course gaming.

Compared to today's technology, computers from the 1970s and 1980s had limited computing capabilities. Nevertheless, one could achieve mastery in operating these machines by putting in dedication and effort. The computers often came with comprehensive books that included details on the instruction set and design schematics.

Activating the power switch, a flashing cursor would appear in just a matter of seconds, beckoning you to unleash your imagination and unlock the virtual world within. Venture through the ruins of the Great Underground Empire, or mount a daring rescue mission in a military complex. When tired of playing games, one could switch to programming mode, with no distractions from social media or video-sharing platforms, and create their own adventures. It was a time of pure creativity and focus, limited only by one's imagination.

For those interested in electronics, the 1970s and 1980s computers often featured user-ports, slots, or sockets that allowed you to connect and interface your own creations with the computer.

The contrast with today's computers is stark. Although they boast millions of times more computing power, the technology behind them has become ubiquitous and almost mystical. Instead of comprehensive design schematics, the documentation for these machines often amounts to a few simple instructions on how to set it up. The wide range of software available to users is overwhelming, but this convenience has also led to a tendency to waste time on non-productive activities like browsing videos and social media.

Over the past four decades, computers have transformed from educational tools that inspired imagination to sources of mindless entertainment, similar to television. Our attention spans have decreased from an hour to just a few minutes, and while the modern computer has opened up a world of information and communication, many people have lost sight of its potential as a tool for learning and creativity.

For those of us who are "old-timers," retro computing has become a popular way of turning back the clock. If you've made it this far, you may be either intrigued by the idea of exploring vintage computers as a hobby, or you may have personal memories of growing up with the computer technology of the 1970s and 1980s.

Time to pull this toward the topic.   As a collector of classic computer hardware, I can tell you that these old machines can be both fascinating and challenging to work with. Due to their age, these computers are prone to chip failures and other issues commonly associated with antique electronics. Moreover, repairing them can be expensive, as replacement chips are often just as fragile as the failed ones and may be in short supply. I spend a significant portion of my time simply trying to keep my old computers running. Additionally, I would be cautious about connecting any homemade electronics to the user ports of these vintage machines.

Imagine being able to relive the experience of retro computing without having to deal with the expensive and fragile hardware. This opens up opportunities for you to master the computer, discover the roots of modern computing, and even delve into programming, electronics, and unleash your imagination. This is what excites me about documenting various projects and software for the Z80-MBC2.

We'll start digging into the assembly in the next entry.

 




Monday, January 30, 2023

Exploring the Z80-MBC2 Soup to Nuts: Introduction

 

The Z80-MBC2 is an easy to build single board computer which as the name implies, contains a Z80 CPU at it's heart.  It uses an SD card as a "disk emulator", and contains a 128KB banked RAM capable of running CP/M 3, CP/M2.2, QP/M 2.71, UCSD Pascal, and Collapse OS.

In addition, quoting the author, "It has an optional on board 16x GPIO expander, and uses common cheap add-on modules for the SD and the RTC options. It has an "Arduino heart" using an Atmega32A as EEPROM and "universal" I/O emulator (so a "legacy" EPROM programmer is not needed)."

In every sense, this is a real working computer, not an emulation or a microcontroller pretending to be a CPU.  The Zilog Z80 processor at the heart of this SBC has a lineage that goes all the way back to 1976, and is still manufactured today.  In my opinion, the Z80-MBC2 is the perfect platform for those who are interested in learning computer science, exploring vintage computer systems, learning to program, or creating your own games, art, and hardware interface projects.

Unlike just purchasing a Raspberry Pi, you'll be involved in the assembling the computer from the individual parts.  Don't worry!  This is a very simple 5 chip design which uses easy to solder through-hole parts, and sockets for the ICs.  It's very hard to make mistakes, and chances are like mine, yours will boot the first time you plug it in.

In 2023, we'll explore various aspects of the Z80-MBC2 single board computer:

  • Sourcing and building your own kit.
  • Installing the software CP/M 2.2 & CP/M 3.
  • Exploring the historic Z80 software.
  • Adding a "modern" terminal.
  • Programming in Microsoft BASIC.
  • Programming in Turbo Pascal.
  • Programming in C.
  • Connecting to the real world via GPIO.
  • Graphics, Sprites, and Sound.
  • Expanding the Z80-MBC2

Stay tuned!