Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
My Homebrew Z80 Microcomputer (j89.se)
176 points by XtalJ on Feb 12, 2017 | hide | past | favorite | 58 comments


Build Your Own Z80 Computer by Steve Ciarcia of Byte Magazine and Circuit Cellar fame may also be useful :

https://smile.amazon.com/Build-Your-Own-Z80-Computer/dp/0070...


While not a how-to guide, the Z80 book by William Barden and published by Howard Sams, has been placed online. I believe the same book was printed and sold by Radio Shack.

I read that book after Don Lancaster's TTL Cookbook, also published by Howard Sams. That was around 1981, while I was in high school, and I had practically no electronics knowledge before that. Those books were extremely clearly written, and even today provide the foundation of my knowledge of microprocessors and digital logic. I never actually built or programmed a Z80 machine, but the basic knowledge was readily applicable to 6502 and 8088 hardware and software, and even to today's microcontrollers.

Because of the relative simplicity of those systems, I think they are still a good place for anybody to start. Those articles by Steve Ciarcia too. What a genius, at making the microcomputer revolution accessible to hobbyists.

I loaned those books to my best friend, who vanished with them when his family became missionaries, but I don't think he did it out of malice. I'm glad that I can find them online today, just to take me back to those exciting years.


Agree, I have the Z-80 Handbook by William Barden, and it is really well written and contains a lot of information without being a tutorial :)


In 1985, when I first got out of college and started having spare money, I was finally in the position to build a Z80 computer (having spent a couple years in HS using trs-80s). I got the Steve Ciarcia book, started designing my own machine ... then I realized that a 68K CPU was only about $20 more. So I scrapped my Z80 plans and build a 68000 board instead. No regrets.


I think my next project will be a computer based on the 68000 and the ISA bus :-)


Here is a 68000 machine with an ISA bus I built in 1987:

http://www.merlintec.com/lsi/merlin2.html

It originally had an Ethernet interface instead of a bus, but since I couldn't get a PC Ethernet board to connect it to I ripped that out and did a simple ISA (actually 8 bit PC bus instead of full ISA) interface. This allowed me to use PC floppy and HD boards as seen in the picture so I could have a "sneakernet" in place of the missing Ethernet.


Wow, really cool. Do you have more documentation about the ISA bus implementation? :-)


Any way to get that book under 50 bucks?


Looks like you can get a PDF legitimately for free.

https://www.modmypi.com/download/BuildYourOwnZ80.pdf


I was about to say, there's a PDF out there (I did the scanning from my physical copy, after we got permission). Thanks for digging it up!

Edit: Wow, I dug up my original files and realized I did this almost ten years ago: http://www.mrbill.net/byo/


Thanks for the good work! I just want you to know that your scan is still going good work 10 years later. I'm going to read through it and hopefully I end up with a more modern version of this Z80 machine.


The first thing I did was search for the title when I saw the price and this link was what I found.

I doubt that I'll ever get around to building one but now, I have the option.


Recently found Z80 video of how a guy makes ZX Spectrum computer from ground up, fixes bugs and problems as he proceeds. Video is in Russian, but still amazing even if you don't understand it!

https://www.youtube.com/watch?v=8rWCYo1UcOQ


A lot of the ZX Spectrum functionality and logic is in the ULA, an ASIC.

There's a whole book on the ULA - http://www.zxdesign.info/book/theZXSpectrumULA.shtml


Actually there is now design out of 74ls series logic that replicates functionality of the ULA (it is probably completely bug-for-bug compatible), IIRC it was designed by author of said book.


Nice, I'm thinking about making it possible to connect it directly to a display/TV and keyboard. Now, I have to have a terminal or laptop + terminal emulator.


It seems hard to drive a vga display without resorting to fpgas or an avr.

If composite is enough, the NES PPU could be a fun addition to that design :)


Apparently, it can be done with a bunch of TTL logic chips.

http://forum.6502.org/viewtopic.php?f=4&t=3329


Yes, the composite solutions sounds more fun :-)


A Propeller Chip does this easily.



I built an RC2014 and I really like it. I'm using some of Dr. Scott M Baker's boards (WD37C65 floppy controller and 512k banked RAM/ROM) so I can run CP/M. I'd like to get things set up so I can build CP/M on the RC2014, but for now I'm just starting to learn the tools.

I have a Wyse-55 terminal acting as a display with some ACIA board modifications to allow hardware flow control so it doesn't get overrun. I also have a VFD that'll do 40x15 characters or so, which is narrow for a CP/M system, but I should be able to modify the few programs that'll really make a mess on a narrow screen.

I've got a bunch of pictures on twitter if anyone is interested: https://twitter.com/FeatherOrNot/media


Z80 micros are a lot of fun. I was looking for a kit last year and ended up building this one:

http://cpuville.com/Z80_kit.html

Getting it to work and writing simple programs is really satisfying and totally worth the burns from learning how to solder.


Yes, the programming is the fun part so if you don't want to design a new computer from ground up, a kit or a complete computer is to recommend :-)


I love this. I started on a project to do a homebrew Z80 machine late last year as well. I haven't made much progress yet, but I'm really champing at the bit (no pun intended) to get this going. Reading stories like this is really motivational! And it's always good to learn from those who went before...


It is a really fun project to do, so I think you should continue :-) I'm going to add more documentation on the website, like timing diagrams etc. that may be useful for other people building a Z80 computer.


It is a really fun project to do, so I think you should continue :-)

Oh I will. Things just got bogged down over the holidays and everything late last year. My next step is to get everything setup so I can program an EEPROM with my Arduino so I'll have a way to load a program to bootstrap the system. I'm intentionally doing things the hard way though, to maximize my learning. For example, I'm using an Arduino Uno which doesn't have enough digital output pins to represent both the address bus and the data bus for the EEPROM. So instead of just grabbing a Mega out of the parts box, I am using SIPO shift registers to setup a serial -> parallel bus so I can program the EEPROM with fewer wires from the Arduino. No, it isn't efficient, but it'll teach me to use shift registers.

One of my other "next steps" is to just breadboard that Z80 "test circuit" and see if I can get some LED's to blink. I have to get the clock stuff figured out as well...

Like you said, it's a lot of fun. :-)


Sound like you have the right mindset ;-) The most boring part of the project was routing of all the bus lines in KiCad, but I knew that if a kept on working, the reward would be big :-)

I was actually planning to do a ROM emulator with a PIC MCU at first, but ended up using a regular EPROM, SIO/UART and a bootloader to load programs via RS232. When I had a stable program, I burned it to the ROM and continued. This is because when I got started with the "test circuit" I didn't want to go back to the PIC :-D

I'm currently developing my ROM monitor so that I can get CP/M running :-)


Quick note: if you want a full-hardware "computer" (screen, keys, cup and I/O stuff) consider buying an old Texas Instruments calculator: models up to Ti86 have a Zilog Z80-similar (ISA-compatible) inside, the TI89 and later have a Motorola 68000 cpu inside.

The Ti86/Ti89 are programmable in both Assembly and BASIC (interpreter on-rom). If you are willing to buy the data cable and fiddle with SDCC (Small-devices C compiler, a "mod" of gcc) you might program them in C as well.

Links:

* Ti86: https://en.wikipedia.org/wiki/TI-86

* Ti89: https://en.wikipedia.org/wiki/TI-89_series

* SDCC: http://sdcc.sourceforge.net/


I actually own a Ti-82, but I have never programmed it :-)


You can program it without any hardware. There is an intepreter and an "ide" on-board, look for the PRGM key.

Also, I saw there is an "ASM" command, but I didn't check if it can assemble stuff or anything.


Sounds great :-) Only problem is the "not-so-great" keyboard :-/


Make sure to check ticalc.org for your calculator community needs ;-) It is based around Texas Instruments calcs and has downloads for compilers, assemblers, utils, games, etc.


It looks awesome. I'm looking forward for your documentation.

Is the PCB multi-layered, or two layers? Could you also comment which software did you use to design it? I've used Eagle CAD quite a lot in past and it works great, though I always wished to use KiCAD because it's open source. Thank you!


Thank you, I will write and publish much more documentation as soon as possible :-) It is a four layer PCB, one for Vcc, one for ground and the other two for signals. I designed it in KiCad and ordered it from PCBWay.com.

I will also upload the schematic etc. if anyone wants to have a look or create one their self. However, if anyone wants to build it, it may be a bit expensive due to the high IC count.


would you be willing to share a pricetag?


Yes :-)

Five PCBs cost me $250, but they can be made cheaper. Otherwise the price depends a lot on the components. Ceramic ones are very expensive and the whole computer would probably end up at around $300 - $400. For plastic components, the price would be more close to $200.


That is awesome. Coincidentally, I've been spending my weekend revisiting my Z-80 based Nascom 2 (see http://nascomhomepage.com/) and playing with Turbo Pascal's great grandfather, BLS Pascal. Even now, ~ 35 years later, I still think good code generation on the Z-80 is a significant challenge and wonder what else could have been done with the transistor budget and technology constraints of the time.

Good times


I have not heard of BLS Pascal, but it is possible to run Turbo Pascal (version 3, I think) on CP/M, which I intend to do when I have the OS in place :-)


The original CP/M version was called Compass Pascal (and might have been Poly Pascal also). Under Borland it was renamed (and expanded?) as Turbo Pascal.


You just made me search for BLS Pascal. :)


I've been wanting to do a project like this for a while. Specifically, wanting to write a basic program to visualize ALDL data from my 88 fiero on an 8 or 16 bit homebrew mini system, for extra retro goodness. Ideally I want a keyboard and serial port, a vga out, and a spot for a cf or sd card. Maybe running cp/m or similar. I've looked at rc2014 and similar and even some fpga options, but haven't settled on the right starting point yet. Ideas?


The easiest way is probably to buy an old computer from the eighties, but they can be very expensive :0 I don't know much about other homebrew computers, but mine (Calculon/80) could probably be expanded with those things. I haven't tested the expansion port yet, but I will when have some time :-) Also, if it does not have to be using the Z80 CPU, I would recommend the Motorola 68000 CPU, which I will use in my next project.


I'll check out the 68000 stuff. I've mostly been looking at z80 and 6502 at this point, so maybe that's the key to a wider world.

I enjoyed reading about the Calculon/80 and look forward to seeing your next project.


Thank you :-)

I think that the 68k will be more fun to write OS and other software for as it is 32-bit, has memory protection, and can run UNIX :-)


You might like the zeta 2 SBC. It's small and easy to build, and if you combine it with the ParPortProp board, it has all the features you mentioned. It runs CP/M, so you can run your editor, compiler, assembler, etc onboard.


And down another rabbit hole I go :) looks interesting, I'll definitely research more, thanks!


I just started doing something myself. [0] RC2014 is a solid base, but doing the hardware yourself adds even more fun. I am currently waiting for my PCBs and then will start to assemble and program the thing.

[0] https://github.com/jhbruhn/CPD-80


I really like how the RC2014 is laid out. Maybe from a "walk before I run" standpoint I should build one for the experience then make my own expansions cards from there.


Perhaps not the "world's smallest", but pretty small:

http://noplabs.com/cpm50/cpm50.html


Gosh, that PCB is a thing of beauty. Besides being a sucker for black soldermask, labelling less really seems to make the labels more useful.


I think maybe the regular black would be more beautiful than the matte black, it wasn't really what I expected. Adding fewer labels makes the task easier for me ;-)


There's something nice about all that classic silicon on such a clean, modern looking board.


Thank you, it was exactly the look I was after :-) But the logo was supposed to be copper but it is "silver". I don't really know why...

This was the effect I was looking for: https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQHkdLM...


Similar project featuring a screen and I2C bus: http://benryves.com/projects/z80computer


This is just remarkably uninteresting. Interesting fact however is that there is no CP/M simulator for Linux. Only MSDOS has. So you have to first run DOSBOX and then CP/M. -- I recently found copy of MUMATH from 1979 and it was as good as I remember it was.


There are plenty of CP/M simulators for Linux, but they're very niche and hard to find (and use).

I used to do C development for the Z80 using one; it translated CP/M syscalls to Linux ones, and would let me run the CP/M version of Hitech C more or less as if it were native. It worked all right. Hitech C was only a K&R C compiler and didn't produce great code, but it was entirely self-hosted.

The script and emulator I used came from here (look for 'Hitech C on Linux'):

http://uzix.sourceforge.net/uzix2.0/index.php?page=down

...but while searching for that I found this other emulator, which looks a bit more maintained:

http://www.seasip.info/Unix/Zxcc/index.html


Do you mean the text? I was writing the text for me, as some kind of project log. Actually, I found a couple of errors in the design while writing which I wouldn't have found if I haven't written the text.

The text may only be interesting for people building or thinking about building a retro microcomputer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: