Category Archives: z80

Anything related to the z80 CPU

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.

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

 

Introducing the Whizz-80 computer

The Whizz-80 is my latest electronic project that I am starting. It is a combination of hardware and software so it aligns both my passions.

My Whizz-80 computer will be a retro based computer using the Z80 CPU. The Z80 was used in early microcomputers (such as the Microbee and the TRS-80). It will however run it’s own operating system and it’s own specific hardware configuration. I don’t intend on making a clone, (there are plenty of emulators for that) but a unique computer just for me.  It’s a great way to learn how computers actually work and since studying it I have a greater appreciation and respect of the hardware of modern computers.

So why use a Z80 chip instead of a different one like based on the 6502 (as in Commodore64)? There are many blogs out there compring the 2, but the reason why I chose the Z80 over the 6502 was simplicity and documentation. The Z80 requires minumum components to get started while the 6502 needs a few extra chips to get started. There also seems to be a better supply of Z80 components (They still make them!) than the 6502, so Z80 components are more easier for me to obtain (I’m sure your milage might be different). Also, since this is my first major build, I wanted to keep it as simple as possible and have something up and running as early as possible.

My initial thoughts, goals and ideas for the Whizz-80 computer are as follows:

Whizz-80 Hardware Specs:

  • The CPU will be based on the Z80 CPU running at around 6Mhz max.
  • 32Kb ROM and 32Kb RAM. This is more than enough memory for our needs, however it simplifies the amount of extra logic circuitry required if you use smaller memory chips.

Whizz-80 Software:

  • Operating System I will write and will be Forth based. I’ve always been intrigued with the Forth language, but I will probably tackle this once I have the hardware built

Stay tuned for upcoming blog posts on more of the Whizz-80 computer.

Beyond the Arduino

I’ve been playing around with the Arduino for a while now (offline to the blog) and while it is a great platform to get into the embedded arena (and electronics in general), I am yearning for something a little bit more, something beyond the Arduino.

I haven’t done a blog post in a while (I had great plans on posting my experiments and circuits as I learned) but the time it takes to create a post on a simple circuit that I built during the learning iteration process just didn’t work.

I was keen to move onto the next ‘idea’ so by the time it came to sit down and write something it was 3 mini-projects later. All I can say is that the best way to learn is to just physically build it.

Recently I’ve been studying digital circuits (nand2tetris is a good course) instead of analogue circuits and have been fascinated on how an actual the computer works (right down to the inner workings of the logic chips).

I think it is now time to move beyond the Arduino and get myself into some other projects. Maybe something that isn’t Arduino but is a little bit old and feeds my nostalgic urge (hint: z80).