Another Z80 Computer Build - Page 1
Forum section: electronics / general

author: spudboy488
author_rank: Regular Contributor
timestamp: August 26, 2016, 12:00:12 pm
content: Inspired by some of the other Z80 builds outlined here, I thought I'd put one together as well. I've started a Blogger page to document what I've done, to an extent, if anyone's interested. It can be found here:http://modernretroz80.blogspot.com/It's very minimal and that's by design.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 26, 2016, 02:28:47 pm
content: Nice! I see some similarities withmy design:beer:

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2016, 03:22:41 pm
content: If I was building a ROM-less Z80 with a hardware loader/debugger, I'd want to be able to write-protect areas of the RAM, maybe in 8K pages (because that can be done conveniently with a 3 to 8 line decoder, an 8 switch DIP switch and an 8 input AND), and I'd probably add battery backup to the RAM (assuming its SRAM).Using the other 64K of the RAM is more complex. A crude paging scheme that swaps the remaining RAM into the top 32K of the memory map is possible without much extra logic, but if you want a more capable MMU that can realistically support CP/M+ or MP/M, take a look at Obiwanjacobi's design.Another useful facility is to decode a small block of I/O addresses to force the Z80 into a wait state and interrupt the PIC. You also need a tristate buffer between the PIC and the data bus activated by the decoded I/O address ORed with /RD, so the Z80 can grab data from the PIC after the PIC releases the wait state. That lets you implement peripherals in the PIC as software, sniffing the Z80 bus, and have them appear as hardware to the Z80. As the PIC has two USARTs and two MSSP peripherals, it would be possible to implement a buffered serial port, and SD card interface with minimal extra hardware.

author: spudboy488
author_rank: Regular Contributor
timestamp: August 26, 2016, 04:05:05 pm
content: All good points but that's not what I'm after. I wanted to put together a simple system for playing/experimenting with. It will never have a permanent function so there's no need for ROM/Battery backed RAM. It's more for nostalgia in resurrecting a system I wanted to build back in the mid-80's. I'll write some assembly code and re-do some of the labs I did in school that I did on an 8085 system.I had initially thought of using the programmer PIC as a UART as well and had a design that I thought would work but for various reasons, I decided to go the route I took. I'll build up a UART (probably using a PIC) that connects to the expansion port. For now, the next expansion board will be a simple IO board that will read a 8 position DIP switch, write to an 8 bit LED bank, and write to an 8 bit, 2 character, 7 segment HEX LED display. An added note on the HEX display. In the Ciarcia text, he uses HP7340 hex displays. Similar displays are ~ $30 each nowadays. I came up with a design using a $4 CPLD that can encompass all the functions described for the board. The only other components are LED drivers, the switches and pull-ups, and LEDs/7 segment displays.

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2016, 06:56:35 pm
content: Well if you are keeping it to lab Z80 SBC style specs, I'd put together an I/O board with a Z80 CTC and two Z80 PIO chips. It will also need two 74HC138 chips to decode I/O addresses for the PIOs and CTCs. Fit jumpers to let you cascade the CTC counter/timers, and cascade IEO and IEI for each chip so you can use vectored (IM2) interrupts. You can then connect keypads, DIP switches and 7 segment or individual LEDs to the PIO ports as required.If you want a better display, you can also connect a HD44780 LCD in 8 bit mode direct to the Z80 bus, but you need a wait state generator to slow the E pulse down enough.

author: 22swg
author_rank: Frequent Contributor
timestamp: August 26, 2016, 07:00:20 pm
content: PIC as a Z80 supervisor / programmer is an interesting concept , I got this one running but didnt see any final use for the end result... [No battery backup shown]PLEASE NOTE Also a work in progress

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 27, 2016, 10:25:56 am
content: Yeah, protecting RAM is one thing I also have to look into but it has no prio at this moment.I think I want to tackle storage first and then perhaps video and audio...Somehow I ended up currently writing aZ80 simulatorfor unit testing my OS. (dunno how that happened) - and it's more work than I thought (isn't it always)...

author: 22swg
author_rank: Frequent Contributor
timestamp: August 27, 2016, 01:47:21 pm
content: Can't beat loads of stripboard., never did get battery backup wired, Idea was to write pages of code from EEprom, to Z80 Static RAM using the WAIT function.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 27, 2016, 02:19:50 pm
content: Quote from: 22swg on August 27, 2016, 01:47:21 pmHow would that work?

author: 22swg
author_rank: Frequent Contributor
timestamp: August 27, 2016, 03:39:50 pm
content: Hi OB...... It did work ! rather well.. after a Z80 reset by the PIC ... wait 3 clocks for M1 & RD (first instruction fetch Addr h'0000 ), this triggers WAIT Low while inhibiting the Z80 RD to the SRAM, PIC can do what it liked ( write / read/ both / none ) on release of WAIT a h'00 (NOP) is already on the bus provided by PIC port D , Z80 steps to next address , PIC waits for next M1 you now at Addr h'0001 etc ( you following this ! ) check A0 has changed state (stop PIC flag error if not ), PIC now has control of data to memory ... carry on till you run out of siliconI could even enter a 'goto Addr ' at the PC and PIC incremented Z80 to that address. PC terminal was used to load PIC's I2C EEprom 256 bytes at a go seemed useful, (system also did single PEEK / POKE.) it was then sent to Z80, eventually PIC gave memory back and Z80 ran the code.... PIC has to run somewhat faster than the Z80 I had 10M Z80, so PIC18F45K22 was at 16 MIPS . As I didn't really see an end use other than it was possible and fun it ground to a halt .PIC inputs / outputs to Z80 were Reset , M1, Disable WR, WAIT, RD, A0, Data bus (. I had 'played' with Z80 in the 1980's and had it running a MiDi controller..

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 28, 2016, 06:46:43 am
content: Sounds like you're disconnecting the RAM and feeding the Z80 instructions produced by the PIC that reads it from (its internal) EEPROM...?I just turn on BUSREQ and dump the program into RAM, then reset the Z80.

author: 22swg
author_rank: Frequent Contributor
timestamp: August 28, 2016, 09:26:20 am
content: wilfred Yes can do I will re-do and edit my schematic post asap , not got to grips with diptrace yet , don't want to hijack spudboy's thread too much.Edit done ,

author: spudboy488
author_rank: Regular Contributor
timestamp: August 29, 2017, 07:33:19 pm
content: It's been a while since I worked on this but a few things have happened since my last post. What's been done so far is covered in a bit more detail in the blog in the first post.A quick list:1) Z80 with 64K RAM board designed, built and tested.2) PIC controlled programmer designed, built and tested.3) Software written to allow dropping a Intel HEX file and having it sent to the programmer to program the Z80 RAM.4) A simple IO board (LEDs, switches, and 7 Segment displays) was designed, built, and tested. Glue logic and binary to HEX 7 segment display decoding done with an Altera CPLD.5) Version 2 of the programmer added a 128Kx8 SPI EPROM to save Z80 programs which could be auto-loaded on boot.6) Put the programmer and a power supply in a box with the Z80 board mounted on top.7) Added a UART to the Z80 board. Designed, built, and tested.Next steps are:1) Get Grant Searle's Z80 SBC Basic working.2) Modify the programmer software to save a copy of the Z80 board RAM (basically an image dump) to the PC through the programmer board.3) Maybe add some kind of system storage and try to get CP/M to run?

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 31, 2017, 06:01:18 am
content: Nice!