Close

Look who's back

A project log for Z80 Computer

Yet another Z80 computer.

james-otsJames Ots 10/10/2021 at 20:470 Comments

So I was going to do the Retro Challenge this year using an FPGA to implement some kind of 8-bit computer, but I accidentally plugged my laptop power supply into the board and it went pop. So I decided it was about time to dig out my Z80 computer project and see what I can do with it. It was a bit dusty, and so was my memory of how it was put together. This project log jogged my memory a little (although I didn't remember it existed initially!), and the source code for the Z80 monitor and the CPLD glue code helped too, but there was still a lot of gaps that needed to be filled in. Not least the fact that I couldn't remember what power supply it needed.

So I had to look up the part numbers on the power regulator and discovered that it would run on a 5V supply. A lot of my stuff has been in storage since we moved house, but I did have a 5V power supply. The polarity was the wrong way round, but that was easily sorted on the board. Plugging it in didn't make anything go pop, thankfully, and I also got some flickering LEDs, which seemed to be a good sign.

The next thing to remember was how to talk to the computer. I knew it was an FTDI chip of some sort, but couldn't remember the details. Plugging a USB cable into it made a ttyUSB0 device show up briefly on my computer before disappearing again. It took a ridiculously long time and a lot of fruitless searching on the internet before I discovered that my Xilinx ISE Virtual Machine was nabbing the USB device to use as a JTAG programmer. A simple click of a checkbox and the interface was working outside of the VM.

Then for some reason, no matter what app I used to connect to that device, it was really unreliable at sending and receiving data from the computer. Sometimes I'd reset the board and it would work perfectly, but other times only a fraction of the characters would get displayed. To solve this eventually I wrote my own terminal programme, using NodeJS and webusb, which oddly enough was far more reliable than using screen and libftdi_sio. In fact, it seems to be pretty much rock solid. The other advantage of this is that it can tightly link in with my Z80 Monitor programme so that I can upload new binary files really easily.

I don't think I have the latest version of the VHDL code for the CPLD board. I've downloaded what I have in my github repository, but I think I must have a newer version on my desktop computer, which is in storage. However, I've rebuilt the version that I have and uploaded it to the board and the computer still works, mostly. The RTC doesn't, and I suspect the SD card won't either, but I haven't got as far as testing that yet. These problems are probably both because they're connected to different pins from those that the CPLD was expecting, so although I've changed the code to connect them correctly, I think I may also have to change something else.

This time I'm taking far more notes than I did before, and I'm adding more comments into the code so that if I leave it for a few years again I'll have a fighting chance of knowing what's going on next time I come back to it.

Discussions