z80 development workflow on mac osx

After trying different z80 assemblers and simulators, I have found a z80 development workflow that works well for me on my mac .

There are quite a few open source tools to use, and finding the right combination has really improved my z80 assembly learning.

The z80 development workflow

I have come up with the following workflow:

z80 development workflow

There are four stages of my work flow. If it looks similar to a edit/compile/debug cycle then you are right.

1. Text Editor

You need a way to write your z80 code. Any text editor will do really, however I am currently using sublime 3. I don’t have any syntax highlighting  setup as of yet, as I haven’t found a suitable one as of yet (maybe I should create my own). All my code is saved as .asm files.

2. z80 Assembler

Once you have your .asm files you need to assemble them using an assembler. I am currently using zasm which seems to be one of the better ones with full documentation and is actively being developed. What separates zasm from other assemblers is that it has some features that I may use in the future, such as macros, that other assemblers didn’t support or was klunky.

More importantly, zasm can also output Intel Hex so I can run in a simulator (more about that below) as well as raw binary files ready for EEPROM uploading. zasm also produces a nice source listing file for later reading and checking.

3. z80 Simulator

I am currently using the z80 simulator from the z80pack suite. I am only using the z80sim component. Why am I not using the z80asm assembler from the z80pack suite? It doesn’t appear to support assembler macros, and it is a rather simple assembler, with a small number of features. There was a limited amount of documentation to get me started with it.

The z80sim application only supports 2 formats, the Intel Hex format and a ‘mostek header’ format which the z80asm in the suite outputs, and zasm (my preferred assembler) does not. It does however output Intel Hex files so that’s why I’m doing that.

The z80pack simulator is nice as you can set software breakpoints and manipulate the z80 memory, registers and flags as you step through your code. It also has a nice text input and text output interface (using port 1) for debugging output devices.

I did come across another z80 simulator which looked really nice and with a tty terminal front end to display all the z80 registers, memory, etc, however I couldn’t get it to compile on my mac (suspect its a 64-bit thing), and I didn’t really want to run a seperate virtual linux machine just to run a simulator.

4. Upload to EEPROM

Once I’m happy with my program, and I want to do some real testing on real hardware I re-assemble my code into a binary file (rather than the hex format I use for the simulator). This allows me to upload the raw datafile into my EEPROM programmer, and then insert the EEPROM into my Whizz80 computer system so I can see it running.

I haven’t uploaded any EEPROM code as of yet as the hardware is still being developed, but I’ll be providing more details about my EEPROM programming at a later date.

 

I’ve also documented this z80 development workflow on the main whizz80 website.

Documentation is Hard

Documentation is hard.

Today I’ve released into the wild the start of the documentation for the Whizz80 project hosted on its own site.

I originally had posts here, as well as on hack-a-day, photos on instagram, facebook,  but I needed a central location to store all my files and documentation.

So I registered the domain ‘whizz80.com‘ and am using the GRAV cms system to keep the documentation up to date. I didn’t go with wordpress as I wanted something simple. It also allows me to keep the website up to date and in sync with a github repository.

It will also keep the main information at a single site (I can still blog about it here, as well as hack-a-day and other sites) but I know there is a central location for all my stuff. It will be a one stop shop where people can download all they need to know about the whizz80 computer system.

It is slow going though, because documentation is hard! Unfortunately if I want people to follow along with the project (and maybe even contribute) then I need to have all the information available.

It wasn’t meant to be an easy project – Documentation is hard!

System Backplane for the Whizz80

The system backplane for the Whizz80 has been redesigned and refined.

I’ve been using Eagle to design the schematic for the Whizz-80 computer. I originally started to hand wire parts of the circuits on prototyping PCB board but found that point to point wiring was just too hard, so I’ve now decided to get PCBs manufactured instead.

So I’m starting with the System Backplane – this is a rather easy board to produce as it is almost a ‘stripboard’ but with a custom silk screen.

System Backplane of the Whizz-80 computer
System Backplane of the Whizz-80 computer

I can only produce a board that is 100mm x 80mm in size with the current version of Eagle that I am running (the Express version). This should be big enough for the sytem backpane, but for the IO board I might need something bigger.

I’ve sent the system backplane off to be manufactured. I’m getting 5 prototypes so hopefully I should get them in a week or so.

Whizz-80

I may have been a little quiet on my blog about the Whizz-80 computer I’m building, but I have been spending lots of time reading and learning more about the z80, and its inner workings.

I’ve also decided to put the day-to-day progress on the hackaday.io website as it can reach out to a target audience rather than relying on people stumbling onto my little blog here. 🙂

If you want to see the latest things happening with the Whizz-80 then head over to my project page at hackaday.io

 

Whizz-80 System Design – it begins here

The system design of the Whizz-80 computer is a little different to what most people seem to be creating. There are many designs of a z80 computer that are based around a single board. While a single board self contained computer is cool and trendy, it doesn’t really give you the flexibility to upgrade, change or expand the system when you want to try something new or add extra functionality. I’m intending on the system to grow and expand as I develop it (it is iterative process as I learn, so mistakes would be made). Because of this I am deciding to use a modular approach and have divided up the computer into 5 distinct core modules. These modules are:

  • Power
  • Timing
  • System
  • IO Bus
  • Monitor
Whizz-80 System Design
Whizz-80 System Design

Each module is designed to be self-contained and can be swapped out with a different (upgraded or fixed) module as required. For example you could swap out the timing module of a slow clock cycle to a faster one, or a manual clock cycle (push button), without impacting the design of the rest of the computer. If I need to up the power requirements I can simply change the power module. If I need more IO output ports or change the entire way input/output is performed then I can swap out this module without affecting the rest of the system.

The system design and concept is heavily influenced by this webpage.  I have taken ideas from this page and have extended it for my own purposes.

Here is a brief description of each module. I will be going into more detail about each individual module as they are built.

Power module

The power module supplies power to the whole system design.
Output of this module is to the System board, and consists of +5v, ground and any reset signals. I’ve linked the reset signal to the powerboard as resets are generally associated with power on/off and restarts. I may create a sub-module of the power module for reset as there are different ways to perform a reset function. (I may need a reset and a /reset signal).

Timing Module

Outputs to the system module. Receives power and /wait /m1 signals (for manual clock controls). Provides a clock signal to the system board (and any other devices as required).
from a simple single step push button, 555 timers, crystal circuilts, and all the way up to a 2Mhz oscillator. I am capping the max speed that I intend to build for to 2Mhz as the faster you make the signals, the more important it becomes with the length of your wires between ICs and interference. I’m not interested in fast clock speeds.

System Module

This is the critical module in the system design as it contains the z80 CPU and memory circuits (ROM/RAM) and any other circuitry required to manage the core system components such as some IO logic circuitry that helps hand off any signals to any other modules (such as the IO Bus module). All other modules connect to the main system module. It is the central module (see diagram above).

IO Bus Module

This module contains the I/O Bus where extra peripherals modules are connect to. It is designed to allow multiple input/output devices to be connected to it via their own ‘sub-module’ card. As this is such an important module (it is the interface to the outside world), more detail would be given on this module later.

Monitor Module

This module is used for debugging the system. Displays the address, data and control busses in a nice format for debugging. It is not a system dependant module, i.e. this module can be removed and the system is still fully functional, you just won’t be able to see the buses. (If you are running a fast clockspeed then you won’t need to watch the bus anyway).

System Design

This is a rather simplified description of the Whizz-80 system, and it only the electronic hardware. This system design is also in a state of flux, as the design may change as new ideas are tested. I am not going to build an enclosure yet as I don’t even know what the final version (if there is one) will look like.

Hopefully I can look back on these blog posts and see how the Whizz-80 system had evolved over time.