Arduino Forum

Using Arduino => General Electronics => Topic started by: bozgrul35 on May 10, 2011, 09:25 am

Title: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 10, 2011, 09:25 am
Hello

I'm trying to connect my arduino Mega to a Z80A chip taken
from an old Amstrad CPC computer.

The final goal is to build a Z80A computer and then don't use
the arduino anymore. But for the present time, I only have the Z80A &
the arduino, no memory chip nor EEProm programmer nor memory
decoder etc. So I thought the arduino could provide the vast
majority of inputs or outputs to the Z80A (eg: RESET pin,
CLK pin, address bus, data bus, etc).
It's only an educational project, I've learned Z80 assembler 30 years
ago, and digital electronic 20 years ago but never got the opportunity
of trying it for real!

After a few hours - late at night - of trial and error, I still
can't make it work. Damn it!
My electronic skills being really basic, I suspect them to
be the cause. (I'm a software writer, so I don't have too much concern about the 'code writing' part...)

Here are my too concerns:

1/ As the arduino and the Z80A both run on 5V, I thought I could directly
connect any pins from the arduino to the Z80A. But the Z80A started to get
very hot, so I think there is a problem! I've read somewhere that Z80A
worked at something like 5V@90 mA (not sure, I have the exact figure at home)
and the Arduino deals 40 mA per I/O pin. I don't see why it would overheat
my poor old Z80A... I've tried to add a 100 ohms resistor between the
Z80A and the ground, it got cooler but always ended up very hot. Maybe
it's its standard temperature, but as it is an old chip and I've had hard
times to find it, I'd rather not burn it!
I could insert a resistor between each arduino-Z80A connexion, but it's too
random and I don't have that many 100 ohms resistors right now!

2/ My second problem is that, when I spy the addresses required by the Z80A,
I've got 0, 3, 7, 3, 0, etc... then 15 sometimes...
I've just written a program for the arduino to send 0xC3 (JP) when the 0 address
is requested, or 0 for any other address, so it will code a JP 0 and forever
loop.
So I'd expect it to request 0 (fetch JP = 0xC3), 1 (first part of the addess), 2 (second part of the addess => jump back to 0), 0, 1, 2, etc...

The hard part is that, since many of interesting pins of the Z80A are active-low, it's not easy
to know if the thing is working or not because I merely get tons of zeros from the pins... !
Which makes me think that... I've only checked the RD pin. I could check the WR pin too,
because there's a chance that they are opposite...

If anybody has an idea...

Regards
Bozgrul
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 09:32 am
I think it would be a good idea if you posted your schematic.
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 10, 2011, 11:10 am

I think it would be a good idea if you posted your schematic.

OK, I'll post it tonight, being at work for the present time.
But it's fairly straigthforward, Z80 pins are either connected:
- to arduino 5V output
- to arduino GND
- to any arduino digital pin I have chosen (ie : clk is connected to pin 53, and the arduino sketch sets the 53 pin down, up 100 ms latter, then again up 900 ms latter, to get a 1 hz frequency)
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 11:18 am
Quote
clk is connected to pin 53, and the arduino sketch sets the 53 pin down, up 100 ms latter, then again up 900 ms latter, to get a 1 hz frequency)

From my (dim and failing) memory, the clock was a symmetric square, not a 10% duty cycle.
Phasing of signals is critical, because things like memory or I/O operations are triggered on particular edges.
Title: Re: Wiring a Z80 to Arduino...
Post by: Grumpy_Mike on May 10, 2011, 11:19 am
Dredging things from my memory I seem to recall that the internal registers of a Z80 are made from dynamic RAM therefore there is a minimum clock frequency. I am sure 1Hz is way too low for the processor to operate.
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 11:25 am
I think it was fully static - though it did have a register that could be used for DRAM refresh.
(My first z80 chip cost about £40, which was about the average weekly wage at the time!)

EDIT: Quick google suggests Hitachi variants had dynamic elements, but not the Zilog ones.
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 10, 2011, 11:31 am
I can think of so many issues here I hardly know where to start.

You can't supply a clock signal to the Z80 from an IO port, you need a high frequency, about 2-4MHz.

The Z80 has NO IO pins, everything is memory or IO mapped at high speed. There is no practical way to directly connect the two chips. You will need latching hardware but the Z80 still needs ROM and RAM to run.

Quote
But the Z80A started to get very hot

The Z80 may just run hot, it's a very old chip.

Quote
I've had hard times to find it, I'd rather not burn it!

Z80s are still produced and easily found.

Quote
when I spy the addresses required by the Z80A,

What do you mean "spy the addresses"?

Quote
I've just written a program for the arduino to send 0xC3 (JP) when the 0 address is requested, or 0 for any other address, so it will code a JP 0 and forever loop.

How will you do this? You have to test the 16-bit address against 0000, turn the data direction around on an Arduino port, then write 0xC3 followed by 0x00 and another 0x00. All within the cylce time of the Z80.

If you just want to test the Z80 you can easily do that by pulling all the data lines constantly low (00 = NOP), the Z80 will cycle the entire memory map and you can view the address lines with a scope.

I must say I love the idea of building a Z80 computer, just for the shear retroness of it, but I don't see how an Arduino can really help unless you want to make what is affectively an EPROM emulator.

In this case the Arduino can be very useful.

To do this your Z80 needs RAM and IO chips and per normal, it also needs an EPROM to run the code from but you substitute a RAM for that and dual-port it with some octal buffers. Now you have an EPROM emulator and you can compile Z80 code and download the HEX file to your Arduino which in turn dumps it into the RAM that is emulating the Z80s EPROM.

It's much easier than I probably made it sound.

I've done similar many times (a while back I admit) and can help if you really want to do it.

______
Rob

Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 11:34 am
Quote
You can't supply a clock signal to the Z80 from an IO port, you need a high frequency, about 2-4MHz.

No, you don't.
My first breadboarded Z80 had a debounced toggle switch for a clock generator.
Title: Re: Wiring a Z80 to Arduino...
Post by: Grumpy_Mike on May 10, 2011, 12:10 pm
Yes AWOL is right it can work with a DC clock, I have just looked up the data sheet. It brings back memories.

Geek warning:-
Did you know that in one Dr Who episode the master had tamped with the program running the universe. He had his assistant read out the code, it was a stream of hex numbers. On a certain string of numbers the Doctor said "That's it", if you knew Z80 machine code hex, that string of numbers was a jump to subroutine call. Some one on the script team must have put that in.
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 10, 2011, 12:43 pm
Well it's been a while, I thought I remembered them as being dynamic.

Quote
It brings back memories.

Me to. I had a Microprofessor development board once and recently found out that they still make them. I couldn't believe it, but can't imagine who uses them.

I'm almost tempted to make a Z80 board just for the sake of a trip down memory lane. You can still buy the CTC, SIO, PIO, DART etc. I used Z80, Z8, 64180 and Z8000 over the years. In those days it was pretty much Zilog or Motorola. Then I went away from embedded stuff for 15 years and when I came back that had all changed.

______
Rob



Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 12:49 pm
After I got bored toggling in programs (no cassette storage and no UV-EPROM programmer), I bought a Nascom 1, but still couldn't afford an assembler, so I became very adept at hand-assembly - I still remember that "INC HL" is 0x23.
How sad is that?
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 10, 2011, 12:58 pm
Quote
How sad is that?

Pretty sad, but I think I can do better.

I used to lie awake at night dreaming of the 68000 and wondering what I could do if I could afford a processor as powerful as that.

And speaking of the 68k, the mob that makes the Z80 development board also does a 68000 board, complete with the 64-pin "aircraft carrier" pack CPU.

Who uses this stuff?

______
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 01:38 pm
Quote
I had a Microprofessor development board

{ Googles }  £270! That's what a Nascom 1 cost 30 years ago!
And it had a better keyboard.
And a video output.

I suspect I still want one, for old-times sake.
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 10, 2011, 02:30 pm
Thank you for all your answers that I read really carefully.
Who said that no one is interested in such oldies? Not me !  :)
I will try again tonite, and follow your advices:
- use a real square signal for the clock (but at soon as I will get it
working, I will try changing clock parameters to see how the Z80 performs
under different clock signals or even manually - with the anti-rebounce)
- bind D0-D7 to GND to permanently send a NOP opcode (brillant idea, I feel stupid that I didn't have it before you tell me!)
- keep the design as simple as possible. I still have a few outputs of the Z80 that I can discard for now, I will care latter (WR or IORQ for example, since I will only read the whole memory)
I will take more time tonite to answer you, when I'm back at home.

Bozgrul
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 02:34 pm
Oi! Who are you calling "oldies"?
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 10, 2011, 02:41 pm
I'm talking about the Z80 of course, no offense.
But maybe it's a joke !?  :)
Sorry, english is not my mother-tongue.
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 10, 2011, 03:05 pm
@bozgrul35
I take back some of what I said before, given that we've determined the chip is static you could probably make a sort of CPU emulator that controlled the clock and looked at addresses then supplied data. A sort of hardware-based simulator.

Here's a good reference page

http://www.z80.info/ (http://www.z80.info/)

______
Rob  
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 10, 2011, 03:25 pm
Rob, that's exactly what I had in mind.
In fact, I read a blog page a few days ago,
where the author gave good explanations about the Z80.
And he did the same page about the 6502 (I'm expecting one,
bought on ebay) but explained the difference, because of dynamic  registers.
(http://www.reocities.com/SiliconValley/2072/z80proj1.htm)
"... It is worth noting that the Z80 is the only major computer CPU in the history of microelectronics that does not use any dynamic registers. Dynamic registers function much like dynamic RAM (DRAM) in that they must be constantly refreshed, or they lose their contents. Virtually every other CPU that was widely used, from the 6502 to the 80x86 family, uses these dynamic registers, and so they have a minimum clock speed which must be maintained for them, or their dynamic registers will lose their contents. The Z80 is so stable that it can actually be stopped at a standstill and still not lose its data. In fact, you can even set up a circuit to hand-clock it with a push-button switch. (If you do so, however, you must connect the button to the clock input pin through some stabilizing circuitry so that it produces a clean rise and fall, instead of a ragged, unsteady rise and fall.) ..."

I didn't find this site (http://www.z80.info/) before, even if I have searched a whole lot of ones the last few days.
Looks promising!
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 03:29 pm
Quote
It is worth noting that the Z80 is the only major computer CPU in the history of microelectronics that does not use any dynamic registers.

Not so; the 6800 and the 6809 were both also fully static.
Title: Re: Wiring a Z80 to Arduino...
Post by: Grumpy_Mike on May 10, 2011, 05:10 pm
Also the Signetics 2650 was fully static and pre dates the Z80 by a couple of years.
It was used in the first Phillips games consoles and was the first Micro computer I built in 1975. I used it in a couple of embedded systems as well, including the first micro processor controlled ham radio repeater in the U.K. in 1976.

My first computer - home built and designed
(http://farm5.static.flickr.com/4072/4578436531_d36d0f5cc6.jpg)
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 06:10 pm
Remember the days of stacking eight 1 x n bit RAM chips and bending out the data pin sideways to save on sockets and wire-wrap joints?

<oxbridge Yorkshire accent> And you tell that t'young people today; they won't believe you. </oya>
Title: Re: Wiring a Z80 to Arduino...
Post by: Grumpy_Mike on May 10, 2011, 06:17 pm
Luxury we used to dream about eight 1 x n bit RAM chips.
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 10, 2011, 06:48 pm
Just found an unused Z80B in my parts box!
I know somewhere in my "filing system", I have a diagram for a five chip Z80 board (processor, EPROM, 6116 RAM, UART and PIO).

Hmmm, this could be a long night.
Title: Re: Wiring a Z80 to Arduino...
Post by: keeper63 on May 10, 2011, 08:57 pm
This has been a pretty fun thread to read; I've got a handful of Z80 processors scored from my favorite haunt, Apache Reclamation, here in Phoenix. They've got a back room (full of NOS vaccuum tubes) with these drawers filled with various ICs in tube carriers - I'm sure in one of them is a cache of Z80 processors (found some 6809P once). Heh - in one of the bins there they had a wire-wrap prototyping board - pretty large, lots of area on the top-side, tons of gold plated pins sticking out from the bottom. I wanted to buy it, but they wanted something close to $100.00 for it - well beyond what I was willing to pay (interestingly, years ago they sold me an Altair for about the same amount).

What I don't understand from the OP - is why did he remove the Z80 from the Amstrad CPC? That was his Z80 computer right there; he would've been better off fixing/restoring that machine (its not like they're making more - and these old PCs and such are only climbing in value as the years go by - I was perusing Apple IIe hardware the other day, and saw that while the prices for a system weren't high - they weren't that low, either; still - cheap compared to an Altair system, which is why I consider myself lucky to own one - albeit in non-working condition right now).

I'm sure somewhere on the internet is an Amstrad club or users group of some sort...maybe.

:)
Title: Re: Wiring a Z80 to Arduino...
Post by: justjed on May 11, 2011, 01:08 am

After I got bored toggling in programs (no cassette storage and no UV-EPROM programmer), I bought a Nascom 1, but still couldn't afford an assembler, so I became very adept at hand-assembly - I still remember that "INC HL" is 0x23.
How sad is that?


Not sad at all. Hey, I still think back fondly on my days writing Macro-11 on PDPs. How can you not like an instruction set that contains SOB (Subtract One and Branch). Back then, we worked pretty hard to write really good, clean, elegant, efficient code. I'm guessing any newer embedded system these days has more RAM than we did, and we ran the OS and DECnet, plus our applications. Those were (mostly) fun times.
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 11, 2011, 03:03 am
Hi.
It's very late, I've spent a lot of time trying to make that thing work,
but... it doesn't!
This is how I connected the whole thing: (sorry, didn't find time to draw
a schematic, and I have no dedicated software. Do you know good, open-source ones?)

- not connected:
A4-A15 (I only watch A0-A3)
/HALT,/MREQ,/IORQ, /RD, /WR, /BUSAK, /M1,  /RFSH
- to Arduino 5V :
Vcc, /INT, /NMI, /WAIT, /BUSRQ
- to GND:
Vss, D0-D7
- to arduino:
CLK, /RESET, A0-A3

When I power this on, without any resistor before GND, the CPU overheats
very fast (even if I clock the CPU at 1 Hz... it seems strange to me), and I unplug
it 'cause I'm not sure it won't break.
If I use a resistor, it takes time to heat, but enventually will. And it doesn't work the same.

My sketch is the following :
setup :
set arduino clk & reset to output, arduino A0-A3 to input
reset <- low
clock <- low
every 500 ms, switch the clock output from low to high or high to low
after 3 s, reset <- hi
read A0-A3. if result is different than previously read, display.

When I use a resistor, I've got a fixed 1111 result from A0-A3.
When I don't, it alternates very quickly between 1111 and 0111. (faster
than the clock). But I didn't think of MREQ, maybe I have to check its
value too before displaying A0-A3.

So, still I'm stucked... but I go on searching.
BTW, Rob, thanx for the http://www.z80.info website, I think I will try to
setup the minimum Z80 CPU test circuit (http://www.z80.info/z80test0.htm),
seems a good way to find if the CPU is still OK, and if there is any problem with
the heat...

Time to sleep, I will just try the MREQ thingy before (or I won't be able to sleep!). See ya.

Bozgrul
Title: Re: Wiring a Z80 to Arduino...
Post by: MarkT on May 11, 2011, 03:09 am
Quote

You can't supply a clock signal to the Z80 from an IO port, you need a high frequency, about 2-4MHz.


You can generate upto 8MHz with any of  the timers on the ATmega  by directly programming them.  

The original Z80 should get hot, its NMOS!  Max current 150mA so nearly a watt of heat dissipation (at any clock frequency).  The datasheet says static by design but parts only tested down to 5kHz.  Have you measured the supply current - if its greater than 150mA you can be sure its fried or overloaded.

I suspect any replacement Z80 you can find these days is CMOS and much less power hungry.
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 11, 2011, 03:21 am
Well, MREQ is alway low (active), A0-A3 is always 1111...
Time to go to bed !

Bozgrul
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on May 12, 2011, 12:36 am
Hello !

So, I've tried a new circuit, the Z80 test circuit from z80.info (http://www.z80.info/z80test0.htm),
to be sure that the Z80 was working correctly by itself, before going on.
And the result is... the circuit is not working. But I can't tell right now if it's the Z80 that's not working
or a mistake of mine, during the assembly.
A lot of heat, no LED on.... (btw, I assume that the Z80 can overheat even if it's broken. Is it right ?)
I've made a few checks with my voltmeter, and found some weird results : the resistors next to D0-D4 (or D3, not
sure) show something around 1V, the next one (D5 or D4) is 2.5V, and the remaining ones (D6-D7 or D5-D7) are 0V.
It doesn't seem right, but what can it mean, I cannot tell...
I've orderded a few Z80s from Jameco, because I don't know french shops that sell Z80s. So I'll have to wait a few
weeks maybe... (btw, do you know european shops, where shipping might be quicker - and cheaper ?)

During this time, I will try to do the same thing with a 6502 I've just received from eBay. I have more confidence
in it, so maybe I'll be able to make it work (even if it works differently, the clock for instance...).

I'll tell you as soon as I have any interesting results (w/ the arduino, of course!).

Bozgrul
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 12, 2011, 11:08 am
Sorry I don't get the D0-7, there are only 3 diodes on that schematic and they are LEDs.

Quote
I assume that the Z80 can overheat even if it's broken. Is it right ?

Yep, it could go either way depending on what's cactus.
______
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: MarkT on May 12, 2011, 04:37 pm
D0..D7 is the Z80 data bus, just as A0..A15 is the address bus.
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 12, 2011, 05:41 pm
Quote
D0..D7 is the Z80 data bus, just as A0..A15 is the address bus

I think it is the thought of wiring all that lot up more than anything else turned me on to microcontrollers!
My FYP was a 6800 controlled rover, and I damn near sprained my wrist wire-wrapping it.
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on May 13, 2011, 02:51 am
Quote
I don't get the D0-7

Quote
0..D7 is the Z80 data bus, just as A0..A15 is the address bus.

Doh, I must have written that before my first cup of coffee.

All the data lines should show 0v I would think, if that's not the case then the chip must be stuffed.

_____
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: Kctess5 on May 15, 2011, 12:34 am
This project sounds prime for an FPGA
Title: Re: Wiring a Z80 to Arduino...
Post by: AWOL on May 15, 2011, 12:38 am
That would be cheating
Title: Re: Wiring a Z80 to Arduino...
Post by: bozgrul35 on Jun 08, 2011, 03:55 pm
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
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on Nov 12, 2013, 11:17 am
OK I know this thread is as old as my granddad.

If you're still there Boz, did you do any more with this?

_____
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: UnoDueTre on Nov 12, 2013, 09:18 pm
Really enjoyed reading this thread and remembered having some old books lurking about some where.
Title: Re: Wiring a Z80 to Arduino...
Post by: JimboZA on Nov 12, 2013, 09:31 pm
graynomad said "I had a Microprofessor development board once"

Me too, left it at the office, went on annual leave (late 1983 iirc?... shit, exactly 30 years ago...), and some bar-steward stole it. I was not best pleased.....
Title: Re: Wiring a Z80 to Arduino...
Post by: TomGeorge on Nov 13, 2013, 02:34 am
Hi, I still have mine...

Tom... :)
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on Nov 16, 2013, 03:51 am
Quote
I still have mine...

I bet you don't use it much :)

_____
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: TomGeorge on Nov 17, 2013, 12:11 pm
Quote
I bet you don't use it much smiley


No not much. lol.

Tom... :)
Title: Re: Wiring a Z80 to Arduino...
Post by: JoeN on Nov 18, 2013, 06:42 am
Z80s as microcontrollers now exist, if that matters to you.  Zilog makes "eZ80", Z8 "Neo", and "Z16" (16 bit architecture) as well as 8051 microcontrollers.  You may be able to sample them.  They also provide a free compiler and a very cheap programmer.

http://www.digikey.com/product-search/en/integrated-circuits-ics/embedded-microcontrollers/2556109?k=ez80
http://www.digikey.com/product-detail/en/ZUSBSC00100ZACG/269-4539-ND/1206981
Compiler/IDE:  Search for "ZDS II - eZ80Acclaim! version 5.2.1 with RZK and TCP/IP Object Code" on Google (it's at the Zilog Store but there is no direct link).

I was able to get simple projects running with the Z8 Encore, eZ80, and the Z16 microcontrollers using the linked programmer and the free software.
Title: Re: Wiring a Z80 to Arduino...
Post by: Cactusface on Nov 19, 2013, 04:07 pm
Hi bozgrul35 ,
                             The Z80 I remember that, did a lot of work on that, in fact learnt most of my stuff on it back in the 80's.
Take a look here:  http://melsaunders.x10.bz/

Regards

Mel.
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on Nov 20, 2013, 09:18 pm
Love that stuff Mel, do you still use it?

Last I looked (maybe a year ago) you could still buy all the Z80 chips, SIO, PIO, CTC, etc etc. Over that period I have designed several modern boards with LPCs/SAMs etc but they all get too complicated for a one-man band to develop and produce in a reasonable time frame, and of course they are out of date two weeks later and also there are so many great 32-bit boards around now for about $1.50 I see little point in producing yet another one.

So, maybe the answer is to go retro, after all there won't be any competition :)

A Z80 board with an AVR co-processor that acts as an EPROM emulator would be a simple and fun project, but the question is what the heck would you do with it? Once you get it working and flashing a few LEDs what's next?

If I could think of an answer it might be worth doing.

@Joe, that $29 dev kit is "Z8 Encore! XP F08xA Series Dev Kit" but lower down it also says "For Use With/Related Products   Z8 Encore!®, Z8 Encore! XP®, eZ80Acclaim!®, ZNEO™ Dev Boards" so I guess that's the compiler/assembler one could use for the Z80.

Is that correct?

So for the Z80 you would not use the hardware in that kit, just the IDE/compiler?

______
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: graynomad on Nov 21, 2013, 04:50 am
Interesting using C on a Z80, twas all ASM in my Z80 days.

So you are using the flash-based units. If one was to go retro and use an standard Z80 you'd ditch the hardware and use the compiler/IDE to get a HEX file, then get that into an EPROM.

Why did you do these? Was there a need to evaluate the Zilog products? Miss the old days?

_______
Rob
Title: Re: Wiring a Z80 to Arduino...
Post by: JoeN on Nov 21, 2013, 05:02 am

Interesting using C on a Z80, twas all ASM in my Z80 days.

So you are using the flash-based units. If one was to go retro and use an standard Z80 you'd ditch the hardware and use the compiler/IDE to get a HEX file, then get that into an EPROM.

Why did you do these? Was there a need to evaluate the Zilog products? Miss the old days?

_______
Rob


No need.  I just wanted a new toy to play with.  It doesn't matter if it isn't as shiny as some of the others.  I have no anticipated applications for it and as far as 8-bits go.  I do feel a lot more familiar with the AVR architecture.
Title: Re: Wiring a Z80 to Arduino...
Post by: umurri on Jun 04, 2017, 08:37 pm
Oh yes, I know that this post it's very old .... as I am.

At the speed of 1 or 2 MHz of clock for the CPU Z80, Arduino could became a kind of EPROM because when the CPU place the address, Arduino could put the "CODE" of this address lines and then wait for the Fetch. After this, Arduino can wait the next address, and behave as before.
It's a non sense task, but it can be interesting, because you could write a small program code in Arduino.

A strange idea.
Title: Re: Wiring a Z80 to Arduino...
Post by: westfw on Jun 04, 2017, 10:43 pm
As long as this thread has been resurrected from the dead, I'll point out this recent project that implements a Z80 system in 4 chips - the Z80 itself, a 64k RAM chip, an ATmega32a running Arduino SW that does the boot processing and all the I/O, and a 7400 as some higher-speed glue logic.
The ATmega32a is a 40-pin DIP, so it has enough signals to fully control nearly all of the Z80 signals, and can DMA to enough of the memory to load a bootloader, which can then load other SW, including CP/M.
It's got a bunch of clever design elements; IO reads and writes put the Z80 into wait states and wake up the  AVR, which manipulates the bus and then lets the Z80 run again...
(https://cdn.hackaday.io/images/9270461493799956234.jpg)

https://hackaday.io/project/19000-a-4-4ics-z80-homemade-computer-on-breadboard (https://hackaday.io/project/19000-a-4-4ics-z80-homemade-computer-on-breadboard)
Title: Re: Wiring a Z80 to Arduino...
Post by: MarkT on Jun 05, 2017, 03:43 pm
If you want to interface directly to an old microprocessor then the Parallel Propeller chip is a much
closer fit to what's needed, as it has lots of PLLs to generate clock signals, is fast enough, has cycle
perfect timing and 8 cores to parcel the work out to - but a standard Arduino with 8-bit processor
is going to struggle.   You would need to underclock the Z80 by a fair bit I suspect, send it clock edges and
check for Z80 bus control pin changes and service then (memory read/write, refresh, I/O, halt), emulating
the RAM/ROM for the thing.  To my mind that requires about 36 pins I think, so Uno and so on are out
without some clever interfacing circuitry for the busses