Paolo Amoroso's Journal

Z80MBC2

Just4Fun, the maker of the Z80-MBC2 and V20-MBC homebrew computers, clarfied to me the absence of some files is intentional.

Under CP/M-86, the TOD.CMD command for displaying and changing the date and time was left out because, on the V20-MBC, the date can be changed only from the boot and configuration menu. ASSIGN.CMD, a command for assigning physical to logical devices, is specific to the CP/M-86 version for the IBM PC and hence redundant on the V20-MBC.

Just4Fun doesn't recall exactly, but the absence of the Turbo Pascal sample .PAS files on the Z80-MBC2 is likely a consequence of the development process, possibly an early mass storage space constraint.

#v20mbc #z80mbc2 #sbc

Discuss... Email | Reply @amoroso@fosstodon.org

The Z80-MBC2 homebrew Z80 computer is a living retrocomputing museum that runs early microcomputer operating systems such as CP/M, QP/M, and UCSD p-System. Since the latter is the one I know least, I explore it with the Z80-MBC2.

On UCSD p-System the user runs programs and manages the system through a series of hierarchical menus, unlike the command interpreters of other operating systems. Navigating the menus down the hierarchy is easy, but sometimes I'm not sure how to get up one level. Pressing the Q key works most of the times, but occasionally nothing happens and I get stuck.

Running UCSD p-System gives a sense of how slow the output is on serial terminals. For example, a demo program to plot an ASCII sine wave takes almost 20 seconds over a 115200 bps serial line to the 8 MHz Z80-MBC2.

It's best demonstrated by a screencast I recorded, which shows the output as well as the menus. In the video the Z80-MBC2 runs in a Minicom terminal emulator session under Crostini Linux on my Chromebox.

#z80mbc2 #retrocomputing #sbc

Discuss... Email | Reply @amoroso@fosstodon.org

I ported to Intel 8080 Assembly the Z80-MBC2 Z80 code of the led blink demo, assembled it with the Suite8080 assembler, and uploaded the HEX binary to the Z80-MBC2. Instead of printing a message to the console and blinking the User led, the program made the led turn on and the board reset, booting up the default operating system.

I have no tools to debug software that runs on the bare metal. So the next step is to investigate these clues, starting from a comparison of the Z80 and 8080 sources.

#Assembly #z80mbc2 #Suite8080

Discuss... Email | Reply @amoroso@fosstodon.org

One of the Z80-MBC2 boot menu options, iLoad, allows uploading an executable program in Intel HEX format. This is cool because it enables running code on the bare metal with no operating system, such as a resident monitor or software that directly accesses the hardware.

To test iLoad I uploaded and run a demo to the Z80-MBC2, a Z80 Assembly program that prints a message to the console and blinks the board's User LED.

The source file, Blink demo Z80-MBC2.asm, is included in the sources of the Z80-MBC2 firmware in directory src. I assembled the program with the zasm Z80 assembler and converted it to HEX format with the bin2hex tool that comes with the z80pack Z80 emulator.

The screenshot shows the steps for uploading the demo to the Z80-MBC2 and running it. It's a Minicom session under Crostini Linux on my Chromebox.

Uploading a program in Intel HEX format to the Z80-MBC2.

First off, I brought up the Z80-MBC2 boot menu. After selecting the iLoad option, the Z80-MBC2 waited for the file transfer to start.

Next, in Minicom I executed the Paste file command (activated by the Ctrl+A Y keystroke), which reads an ASCII file and sends its contents as if it were typed in, and selected the program file blink.hex. A few seconds later the message Z80-MBC2 User led blink demo running... appeared on the console and the board's User led started blinking.

I completed the process successfully only after tweaking the transmission parameters.

The Z80-MBC2 developer notes the board's serial port can't handle high-speed data transfers, and advises to set a 50-90 ms newline transmission delay in the settings of the terminal emulator used for the transfer.

In Minicon I set the delay with the Newline Tx delay (Ctrl+A T D) option. But with my setup iLoad transfers abort even with delays up to 150 ms, causing the Z80-MBC2 to display a checksum error and halt.

To overcome the issue I set a character transmission delay of at least 5 ms with the Character Tx delay option (Ctrl+a T F).

#z80mbc2 #z80 #sbc

Discuss... Email | Reply @amoroso@fosstodon.org

I develop programs for the Z80-MBC2 in Intel 8080 Assembly with the Suite8080 8080 assembler. Aside from the binary compatibility, the Z80-MBC2 is a Z80 system, so I wondered what Assembly mnemonics and register set the CP/M development tools work with.

It turns out my favorite CP/M debugger, the SID symbolic debugger, comes in two versions specialized on the CPU, SID and ZSID.

SID accepts as input and outputs 8080 mnemonics and registers, ZSID Z80 mnemonics and registers. For example, in this CP/M 3.0 SID session on the Z80-MBC2 I loaded my Twirl 8080 program and disassembled it with SID's l (list) command:

A>sid f:twirl.com
CP/M 3 SID - Version 3.0
NEXT MSZE  PC  END
0180 0180 0100 D4FF
#l
  0100  MVI  C,09
  0102  LXI  D,0139
  0105  CALL 0005
  0108  LXI  H,0142
  010B  MVI  B,08
  010D  PUSH H
  010E  PUSH B
  010F  MVI  C,09
  0111  LXI  D,013E
  0114  CALL 0005
  0117  POP  B7

The output contains 8080 mnemonics. An analogous ZSID session running the same disassembly command outputs Z80 mnemonics:

A>zsid f:twirl.com
SID VERS 1.4
NEXT  PC  END
0180 0100 CDFF
#l
  0100  LD   C,09
  0102  LD   DE,0139
  0105  CALL 0005
  0108  LD   HL,0142
  010B  LD   B,08
  010D  PUSH HL
  010E  PUSH BC
  010F  LD   C,09
  0111  LD   DE,013E
  0114  CALL 0005
  0117  POP  BC

SID thus lets me work in a 8080 environment on a Z80 system.

#z80mbc2 #Suite8080 #CPM #Assembly

Discuss... Email | Reply @amoroso@fosstodon.org

ChromeOS 104 delivered the ability to access USB serial devices from Android, an option for controlling the Z80-MBC2 computer from an Android terminal emulator app.

I didn't realize chromeOS 104 improved the support for accessing USB serial devices also from web apps implementing the WebUSB API. On my Chromebox, version 104 is the first that enables controlling the Z80-MBC2 from the web. Here's a CP/M 3.0 session in a serial terminal emulator web app:

USB Web Serial terminal emulator web app running a Z80-MBC2 CP/M 3.0 session on chromeOS.

Up to chromeOS 104, web terminals failed to connect to the Z80-MBC2 as they didn't detect the USB device. With version 104 I tested the following terminal apps, most of which work:

These apps operate the same way. A connection button brings up a system dialog listing the serial devices, like the Z80-MBC2's CP2102 chip. Once connected, the apps behave like other terminal emulators.

Although useful as an additional option for controlling the Z80-MBC2 on chromeOS, these web terminals are experimental or basic apps, have limited functionality, and miss major features like XMODEM file transfer.

#z80mbc2 #sbc #Android #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

ChromeOS 104 landed on my Chromebox delivering a pleasant surprise, the ability to access serial USB devices from Android apps.

When I plugged the Z80-MBC2 Z80 homebrew computer into the Chromebox under chromeOS 104, the system popped up this notification allowing me to connect the device to Android or Linux, not just Linux as before:

chromeOS notification allowing to connect a Z80-MBC2 serial USB device to Linux or Android.

The notifcation confirms the detection of the Z80-MBC2's CP2102 chipset and says:

USB device detected

Open Settings to connect CP2102 USB to UART Bridge Controller to Linux or Android apps

Connect to Linux Connect to Android

I had long been looking forward to accessing the Z80-MBC2 from Android. I researched a great terminal emulator app, Serial USB Terminal, which can connect to serial USB devices, features basic ANSI support, and can transfer files via XMODEM. Although the app runs fine on the Chromebox, I never figured how to connect to the Z80-MBC2. It turns out it wasn't possible, until chromeOS 104.

Selecting the notification's option to connect to Android prompts to run Serial USB Terminal, optionally setting it as the default app for Android connections.

I interacted a bit with the Z80-MBC2 from the Android terminal emulator and it's usable. Here's what a CP/M 3.0 session looks like in the app in landscape tablet mode, the window layout that works best with a terminal:

Serial USB Terminal Android app running a Z80-MBC2 CP/M 3.0 session on chromeOS.

Input goes in a text field separate from the terminal output. It feels awkward on the desktop but natural on mobile devices with touch interfaces.

Serial USB Terminal's ANSI support seems limited or incomplete, but I haven't checked extensively.

I tried transferring a file via XMODEM from the terminal emulator to the Z80-MBC2 under CP/M 3.0. But, as with Crostini Linux, nothing happens and the XMODEM transfer doesn't work. More experimentation may provide clues on the XMODEM issue.

So far I haven't played with the Z80-MBC2 much from Android, but it's great to have another option for controlling the device.

#z80mbc2 #sbc #Android #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

On my Chromebox, XMODEM file transfer from Linux to the Z80-MBC2 is broken, but I've been trying with every new chromeOS version just in case an update delivers a fix. So far the transfer still doesn't work with chromeOS up to 104.

#z80mbc2 #sbc #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

Exploring the Z80-MBC2 is a required learning step for the adventurous hobbyists and electronic enthusiasts who use this Z80 homebrew computer, to whom it's aimed.

The device comes only with schematics, source code, and a few brochures. However, despite the lack of an official manual, there is a lot of information on the Z80-MBC2 scattered across a number of websites. Put together, this content makes for a solid starting point for further exploration.

In my own journey I'm collecting these resources, which I share here in the hope they will help you get started. I'll update the post with more as I discover them.

Features and operation

The closest thing to a manual is the Z80-MBC2 guide by DarS007, a user who compiled an unofficual user guide. It consists of original notes and snippets from other sources organized into an architectural overview, software information, and tips.

The Z80-MBC2 developer Just4Fun published most of the available information on the project's Hackaday page. All its sections are well worth reading in full, particularly Details and Logs. Section Discussion contains Z80-MBC2 user posts with interesting links and tips.

I also recommend the project page of the Z80-MBC, the Z80-MBC2 predecessor with which it shares most hardware and software features. These pages provide complementary content, i.e. the Z80-MBC page has useful information missing from the Z80-MBC2 page.

Just4Fun published much of the same content on his personal website and has an Instructables guide.

The Z80-MBC2 user Coopzone posted some notes on managing virtual disks and files. Another user blogged his experience with assembling and using the Z80-MBC2.

Operating systems

The Z80-MBC2 can boot a number of operating systems such as CP/M 2.2 and 3.0, as well as UCSD p-System.

Nearly all the existing documentation on these historical systems applies to the versions that ship with the Z80-MBC2. The same goes with the application software for these operating systems that's preinstalled on the Z80-MBC2, for example WordStar and Turbo Pascal.

Some of these operating systems and programs are less known. Refer to the official QP/M and Collapse OS official websites for documentation on Q/PM 2.71 and Collapse OS, bootable from the Z80-MBC2.

As for lesser known application software, see the documentation of the VDE text editor on which the CP/M ZDE16 editor that comes with the Z80-MBC2 is based.

Programming languages

Along with the operating systems, the Z80-MBC2 firmware can boot a couple of programming language interpreters like the BASIC and Forth systems in the ROMs of typical 1980s microcomputers.

The Z80-MBC2 ships with a Nascom BASIC implementation modified by Grant Searles. See the Nascom BASIC documentation.

Development tools

In addition to using the supplied software, it's fun to program the Z80-MBC2 in C or Assembly. The project sites of the major compilers and development tools usable for the Z80-MBC2 usually provide documentation:

#z80mbc2 #sbc #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org

I created a YouTube playlist about the Z80-MBC2 Z80 homebrew computer.

The videos visually decument my journey to using, learning, and programming the Z80-MBC2. They are screencasts demonstrating various features of the device and my projects, such as feature walkthroughs, running programs, coding sessions, and so on.

As I gain more experience with the Z80-MBC2, I'll publish more videos.

#z80mbc2 #sbc #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org