Wiring a Z80 to Arduino...

Hello !
Sorry for the long delay (delayWeeks(), a new Arduino function... :)), but
I was waiting for my Z80 - and other electronic stuff - from Jameco (which costed me 44 € for shipping PLUS
44 € for customs... ouch... never again !), and then I became father for the second time... So I'm just beginning
to have a little spare time for me again, before going back to work tomorrow (ouch again).
While waiting for the Z80, I made some tests with a 6502, and it worked perfectly. So, I've done the same tests
with the new Z80, and it works great.

  • I've bought a 1Mhz oscillator, but it's too fast for the Arduino to keep up the pace, even with a basic test.
    So I'm still using the Arduino as the source of CLK.
  • The Arduino plays the role of an memory simulator (using the Arduino RAM for the Z80). For the time being,
    I write my Z80 code and compile it on PC, then insert it into a byte array in the Arduino code.
    (eg: char bytes[]={0x3E,0x20,0xD3,0,0x3C,0xC3,2,0};). Every time the Z80 requests a byte from memory, it is taken
    from this array. Thank you Rob for the suggestion.
  • It also serves as an I/O IC simulator : every time the Z80 outs a byte to 0, the Arduino sends it
    back to the PC via Serial and then I can display it on my PC screen. I will use the same mechanism, in
    the opposite direction, to provide a virtual keyboard to my Z80 computer.

Things I'd like to do now:

  • use a real memory instead of the Arduino. Since I don't have an EEPROM programmer, I'm trying to use a NVRAM
    but for now, it doesn't work (whenever I reset my circuit, some bytes - sometimes a lot- from the NVRAM get corrupted, don't know
    why. Maybe a write occurs during the RESET with the WriteEnabled pin unstable ?). When it will work, I will set up a assembly chain,
    so that I can write code on my pc, then assemble and download it into the NVRAM, with some kind of bootloader at the start of the
    NVRAM (the Arduino will "listen" to IORQ queries on address X, and provide the data to the bootloader so it can write it into RAM - don't
    know if I'm clear !?)
  • use latches to provide more than 64 kbytes of memory (switching banks)
  • connect a parallel 40x2 LCD display directly to the Z80, so it can output text by itself
  • build or connect some kind of keyboard.
  • connect some kind of mass storage. I've only a few ideas right now, like using the SPI interface of an SD-card.
  • connect it to a VGA monitor. The tricky part for me, right now.
    then...
  • write an O/S (multitask would be great, but is it possible without hardware NMI ?) and maybe a compiler before (or use some kind of C compiler for Z80,
    like SDCC)
  • make it multi-processor
  • etc, etc...

Well, that's a lot to do ! It will eventually require a few years...
Thank you again for your advices and help !

cr0sh : sorry, I did'nt have enough time to explain why I'm doing this.

  • first, I didn't know you could still find DIP40 Z80 (I knew of the Rabbit one, but where's the fun ?)
  • I'm not interested in repairing it to have it work (I've had a 6128 CPC Amstrad, in the 80's, and emulators are enough for me)
  • it's really for the sake of the educational value : I've always wanted to design and build my own computer,
    but I work in the software businness, which is a really separate world (when you don't work with embedded devices).
  • I was sure the Amstrad was in bad condition. When people sell you this kind of stuff, at a very low price, and without
    the power cord (because they "could'nt find it"), 99 % of the time it's because it's not working anymore.

Boz