• Please review our updated Terms and Rules here

Building a homebrew Z80 board

smeezekitty

Experienced Member
Joined
Jan 15, 2010
Messages
460
Location
Washington U.S.
Hello,

I am thinking of building a Z80 based single board computer but I am still noobish with hardware.
I have worked with some microcontrollers and analog electronics but that is about the end of it.

Since I do not have an EPROM programmer and it looks non-trivial to build one, I was thinking of using an alternate method.
My plan was to have no ROM at all and use a 32K SRAM chip. I was thinking of cheating and using an AVR microcontroller to contain the Z80 code in its own flash memory and copy it to the RAM chip on startup before letting the Z80 fly.

I was thinking to use some latches or shift registers to expand the AVRs output port and use SPI to reprogram the AVR.

As far as the device I/O goes, I am still thinking about. I want to either implement RS-232 or a PS/2 keyboard and LCD display but this will need further thought.

Also, does anyone have suggestions on what type of wire to use on this type of project and where to get it.

Is this a good topology?
 
I know that AVRs are cheap and your scheme should work (AVR could assert /RESET to force the Z80 to tristate data and address bus, write the code to SRAM) and then release the address and data and then release /RESET). For I/O I'd go with a simple UART/USART chip, such as the Z80 SIO or DART (if you wanted to keep things vintage or even a 8250/16450/16550), followed by a MAX232 level translator. If you were particularly perverse, you could use the AVR as a USB connection; see V-USB.

As far as interconnecting things, it's hard to beat wire wrap for reliability and ease of modification. I've been doing WW for close to 40 years on my prototypes--and still use it. You can also use 0.100" prototyping board, such as Veroboard or pad-per-hole and what amounts to soldered wire-wrap wire. Some people like wiring pencils, but I never cared much for them--too hard to modify circuits.

And then there's solderless breadboard but I don't consider that suitable for permanent projects.

You could also just assemble one of Andrew Lynch's Z80 kit boards.
 
Thanks to everyone for the responses.


I know that AVRs are cheap and your scheme should work (AVR could assert /RESET to force the Z80 to tristate data and address bus, write the code to SRAM) and then release the address and data and then release /RESET).
This is basically exactly what I was thinking. I would have to work on designing the AVR port expander.
For I/O I'd go with a simple UART/USART chip, such as the Z80 SIO or DART (if you wanted to keep things vintage or even a 8250/16450/16550), followed by a MAX232 level translator. If you were particularly perverse, you could use the AVR as a USB connection; see V-USB.
I know very little about this but I will try to learn.

I think I will use an Atmega328 which is the same chip Arduino uses.
If I use the internal oscillator in the AVR setup for 1Mhz I will have 17 general purpose I/O pins available to expand for the address and data lines and drive the control lines. I can also set the CKOUT fuse on the AVR to output a ~1Mhz signal on one of the pins that I think I can use to clock the Z80.

As far as interconnecting things, it's hard to beat wire wrap for reliability and ease of modification. I've been doing WW for close to 40 years on my prototypes--and still use it. You can also use 0.100" prototyping board, such as Veroboard or pad-per-hole and what amounts to soldered wire-wrap wire. Some people like wiring pencils, but I never cared much for them--too hard to modify circuits.
I know almost nothing about wirewrap other then hearing about it. What tools do I need? Where do I get them? How do you do it?
And then there's solderless breadboard but I don't consider that suitable for permanent projects.
I would probably build a prototype on breadboard to test it initially then rebuild it on a permanent board later.
You could also just assemble one of Andrew Lynch's Z80 kit boards.
But that is not as fun ;)
sprite9 said:
Someone took a similar approach using a Propeller chip, a 6502 and 64K of RAM. (http://dangerousprototypes.com/2012/...opeller-laptop). You could certainly do the same with an AVR since you are familiar with that device.
Looks interesting although I do not know much about the propeller chip.
 
Someone took a similar approach using a Propeller chip, a 6502 and 64K of RAM. (http://dangerousprototypes.com/2012/02/22/prop-6502-propeller-laptop). You could certainly do the same with an AVR since you are familiar with that device.

You might also look at the Zeta SBC + ParPort Prop which interfaces to Rs-232, PS/2 keyboard,VGA display, Floppy Drive and SD flash.

Someone else (me :)) took a similar approach with an 8085 and a PIC: http://mini-altair.tripod.com/Version1.html
 
The 40-pin DIP ATMega162 has the capability of addressing 60+K of external memory. Could make for an interesting setup sharing SRAM with the Z80.

For wire-wrap, you obviously need some 30AWG wire-wrap wire (sold on eBay), a wire-wrap tool and wire-wrap pins or sockets. You strip off about an inch of insulation from the wire, insert the end into the tool bit, put the bit over the pin to be wrapped and give it a twirl. A gas-tight connection is made. At one time, wire-wrap figured big in mainframe backplane wiring and I think it's still used in military gear. eBay usually has a few OK or Gardner-Denver used wire-wrap guns as well.

The tendency today seems to be to run up a PCB, get a few made, then cut and jumper any errors. Less flexible than wire-wrap, but probably cheaper. Of course, today, more in-circuit programmable logic is used than before, so wiring changes tend not to be so major.
 
Wire-wrap has many virtues if you are set up for it, but is very costly for a beginner these days. I did one project (with a mentor) but found supplies expensive and the result a bit crude and difficult to debug with wires going everywhere in three dimensions. Sockets very pricey and few suppliers to choose from. KiCAD and other open-source CAD programs can let you design and validate circuits from component libraries, lay out the PCB, and generate the files you need for PCB prototyping, which ends up costing less than a board full of wire-wrap sockets. Wire-wrap projects of any complexity can end up thick and heavy, which can complicate housing and interfacing. I'll leave it to the experts.

Rick
 
Wire-wrap has many virtues if you are set up for it, but is very costly for a beginner these days. I did one project (with a mentor) but found supplies expensive and the result a bit crude and difficult to debug with wires going everywhere in three dimensions. Sockets very pricey and few suppliers to choose from. KiCAD and other open-source CAD programs can let you design and validate circuits from component libraries, lay out the PCB, and generate the files you need for PCB prototyping, which ends up costing less than a board full of wire-wrap sockets. Wire-wrap projects of any complexity can end up thick and heavy, which can complicate housing and interfacing. I'll leave it to the experts.

Rick

That doesn't sound too good. I am doing this whole thing with a small budget. I have yet to find a PCB manufacturer that is reasonable either.

I might have to go with the horrible mess of direct wire soldering.
 
Wire-wrap has many virtues if you are set up for it, but is very costly for a beginner these days. I did one project (with a mentor) but found supplies expensive and the result a bit crude and difficult to debug with wires going everywhere in three dimensions. Sockets very pricey and few suppliers to choose from. KiCAD and other open-source CAD programs can let you design and validate circuits from component libraries, lay out the PCB, and generate the files you need for PCB prototyping, which ends up costing less than a board full of wire-wrap sockets. Wire-wrap projects of any complexity can end up thick and heavy, which can complicate housing and interfacing. I'll leave it to the experts.

Well, I've been doing it for a long time. I use a massive hoard of socket pins that I've accumulated and even drill my own single-sided PCB stock. I don't have to worry about getting some freaking auto-router to not run a critical trace to Timbuktu and back. The result looks very nice--but, YMMV.
 
That doesn't sound too good. I am doing this whole thing with a small budget. I have yet to find a PCB manufacturer that is reasonable either.
$5 per square inch, 3 copies:
http://oshpark.com/pricing
I might have to go with the horrible mess of direct wire soldering.
It's not inherently messy; that's up to you...

I like NVRAM chips like the Dallas DS1220/1225; like an EPROM but you don't need a programmer.
 
Wire wrap is no good for analog, RF, surface mount, etc.

But for playing around with DIP packaged digital ICs, it is ideal.

You don't have to use a CAD system (sounds too much like work :( ), and then wait a week to get boards. You can throw something together in an afternoon. Later you can add or change your design easily.

The cost of sockets and wire is a little high, but with a handful of chips like you are describing the difference isn't much. You can use a hand wrap tool. It can be fun.

A lot of the home-brew CPU guys use wire wrap, for example: http://www.bigmessowires.com/2009/05/28/bmow-project-summary/
 
Wire wrap is no good for analog, RF, surface mount, etc.

But for playing around with DIP packaged digital ICs, it is ideal]

I do my wire-wrap over a ground plane and have even used twisted-pair for ECL (lots of ECL boards were wire-wrapped and that's about as close to analog as you can get in logic). My boards typically are single-sided foil FR4, with bare 20 AWG wire on the top side running with bypass caps every inch or so between IC rows carrying +Vcc, the foil side, of course, is ground. I get very good HF performance on that setup. SMT can be accommodated with inexpensive adapter boards (my current project uses a PIC32 100-pin TQFP).

Wire-wrap's like anything else--a lot of it depends on technique.
 
I agree that with good technique you can do amazing things with wire wrap.

My thinking about analog and RF was imagining a lot of discrete parts. With RF people often just solder stuff together with minimal lead lengths on to a ground plane, something like this:

December%2021,%202010-17.jpg
 
I agree that with good technique you can do amazing things with wire wrap.

My thinking about analog and RF was imagining a lot of discrete parts. With RF people often just solder stuff together with minimal lead lengths on to a ground plane, something like this:

Looks awesome until you have to do it that way. ;)
 
I agree that with good technique you can do amazing things with wire wrap.

My thinking about analog and RF was imagining a lot of discrete parts. With RF people often just solder stuff together with minimal lead lengths on to a ground plane, something like this...

Now why does your photo make me think of the late, great, Bob Pease? :)
 
Looks awesome until you have to do it that way. ;)

I've done it before and it worked up to 2GHz. But I cut some little double sided board pieces soldered down for stand-offs to be a little more mechanically secure than this picture. OK for something literally quick and dirty.

Now why does your photo make me think of the late, great, Bob Pease? :)

Somehow the same thing came to my mind a little later, too. Maybe it was remembering this picture:

http://www.rfcafe.com/references/electrical/bob-pease-breadboard.htm

Bob%20Pease%20Breadboard.jpg
 
OK I have some parts now.

I am using an Arduino for testing. First I tested the SRAM and I was able to read and write to it with no issues.
Now I connected the Z80 to the Arduino programmed to emulate a EPROM.
I connected a PUSHBUTTON along with a pull down resistor to the clock pin.

I programmed the Arduino to output 4 NOPS followed by a jump to address zero.

I then watched the serial monitor output of the Arduino which shows the current Z80 address. When I pushed the button I watched the addresses count 0->1->2->3->4->0. Yeah! Its working..

Now I need to make it standalone.

First problem is I do not really know Z80 ASM. Secondly, the z80asm assembler is not accepting my code.

For example I try to assemble:
Code:
LD (0),0
Which I thought would load the value zero into address zero but it give me:
Code:
Assembling....
test1.z80:1: error: parse error. Remainder of line=0
*** 1 error found ***
So I try
Code:
LD (A),0
but I get the same error.
I then tried
Code:
LD (A),A
and I got
Code:
Assembling....
test1.z80:1: error: unable to resolve reference: A),A
*** 1 error found ***
Can someone please help?
 
Back
Top