Author Topic: Another Z80 Computer Build  (Read 5414 times)

0 Members and 1 Guest are viewing this topic.

Offline spudboy488Topic starter

  • Regular Contributor
  • *
  • Posts: 136
Another Z80 Computer Build
« on: August 26, 2016, 12:00:12 pm »
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.

 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Another Z80 Computer Build
« Reply #1 on: August 26, 2016, 02:28:47 pm »
Nice! I see some similarities with my design  :beer:
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12875
Re: Another Z80 Computer Build
« Reply #2 on: August 26, 2016, 03:22:41 pm »
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.
 

Offline spudboy488Topic starter

  • Regular Contributor
  • *
  • Posts: 136
Re: Another Z80 Computer Build
« Reply #3 on: August 26, 2016, 04:05:05 pm »
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.
« Last Edit: August 26, 2016, 07:38:26 pm by spudboy488 »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12875
Re: Another Z80 Computer Build
« Reply #4 on: August 26, 2016, 06:56:35 pm »
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.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Another Z80 Computer Build
« Reply #5 on: August 26, 2016, 07:00:20 pm »
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  :-\   
« Last Edit: August 29, 2016, 08:04:54 am by 22swg »
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Another Z80 Computer Build
« Reply #6 on: August 27, 2016, 10:25:56 am »
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 a Z80 simulator for unit testing my OS. (dunno how that happened  :-// ) - and it's more work than I thought (isn't it always)...
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Another Z80 Computer Build
« Reply #7 on: August 27, 2016, 01:47:21 pm »
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.
   
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Another Z80 Computer Build
« Reply #8 on: August 27, 2016, 02:19:50 pm »
[..] Idea was to write pages of code from EEprom, to Z80 Static RAM using the WAIT function.

How would that work?
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Another Z80 Computer Build
« Reply #9 on: August 27, 2016, 03:39:50 pm »
Hi OB......       It did work ! rather well  8)..  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 silicon :) I 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 (8). I had 'played' with Z80 in the 1980's and had it running a MiDi controller..       
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 
The following users thanked this post: wilfred

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Another Z80 Computer Build
« Reply #10 on: August 28, 2016, 06:46:43 am »
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.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Another Z80 Computer Build
« Reply #11 on: August 28, 2016, 09:26:20 am »
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 ,
« Last Edit: August 28, 2016, 12:29:34 pm by 22swg »
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline spudboy488Topic starter

  • Regular Contributor
  • *
  • Posts: 136
Re: Another Z80 Computer Build
« Reply #12 on: August 29, 2017, 07:33:19 pm »
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?
« Last Edit: August 30, 2017, 11:22:05 am by spudboy488 »
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Another Z80 Computer Build
« Reply #13 on: August 31, 2017, 06:01:18 am »
Nice!  :-+
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf