Putting a ZX81 onto a CPLD

Discussions about Sinclair ZX80 and ZX81 Hardware
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Putting a ZX81 onto a CPLD

Post by Retro-Robert »

Hi.

I'm new to the ZX81 forum, but have recently been toying with the idea of making my own Z80 computer (based on ZX81) . I have some CPLDs GALs and stuff (plus Z80 CPUs obviously). My question is : how many Macrocells does the ZX81 ULA take/need as I have some EPM7128s (128 Macrocells),CY7C341-35s (192 Macrcocells) and EPM9320s (320 Macrocells) I'm sure one of these will do the job ?. The idea is to build a ZX81 using only 4 ICs !

Z80 CPU
8k ROM
32K RAM
One CPLD as Glue logic / ULA

All information and comments welcome.. :!:

Thanks
User avatar
mrtinb
Posts: 1910
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Putting a ZX81 onto a CPLD

Post by mrtinb »

Hasn't this been done already?

http://www.bitcycle.org/retro/zx81/ula/
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Putting a ZX81 onto a CPLD

Post by Paul »

Andy Rea uses epm7128 for this.
I bet it won't fit into 64 macrocells.
I used Andys ULA as a start when making my three chip Zeddy using preprogrammed auto save ram (32k).
It had write protect in the ULA for lower 16k.
So this block wasn't destroyed.
kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Re: Putting a ZX81 onto a CPLD

Post by Retro-Robert »

I remember someone telling me it had been done using GALs and it used less than 128 Macrocells...? though it would be nice to have a few extra Graphics modes and stuff as the original ZX81 was somewhat lacking in these respects. Plus I can get the CPLDs cheap (I already have some) . The CY7C341s are supposedly MAX700 compatible and use a cheap JTAG programmer (they are supposed licensed copies of MAX7000 ICs) and come in PLCC84 , 60 I/O lines. .. the question is : Does anyone know where the VHDL code is for the original ULA ?

Thanks
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: Putting a ZX81 onto a CPLD

Post by RetroTechie »

Welcome to this ZX80/81 forum, Retro-Robert! :D

I'm author of Bitcycle.org site linked above. My CPLD-based ULA uses 34 flip-flops and takes 59 macrocells in an XC9572. For other devices: it depends, as each device family has its own architecture. Only way to be sure is to try (luckily you don't need to build hardware to determine a CPLD design's resource requirements :P ). That said: 64 macrocells will be a tight fit, 72 macrocells less so, 128+ macrocells should leave room for lots of extra's.

But (for a variety of reasons) I'd be very hesitant to use ancient, obsolete or uncommon devices like those mentioned. Altera MAX3000A or Xilinx XC9500XL family are probably better choices. More current / supported, 5V tolerant IO's, reasonable prices, and usable macrocell count/IO pins/package options.
Retro-Robert wrote:Does anyone know where the VHDL code is for the original ULA ?
What do you mean? ZX81 ULA's were designed & manufactured before first VHDL standard was even released. Wouldn't surprise me if they layed out the internal circuits using pencil & paper. :lol: Andy Rea's design was done in Verilog iirc, should be floating around the net somewhere. And if you know VHDL, converting my CPLD design into that should be (relatively) trivial.
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Re: Putting a ZX81 onto a CPLD

Post by Retro-Robert »

At this stage it's all just ideas in my head..what you may call the design or feasibility stage. But one possible solution could be :

Z80 CPU (possibly 20MHz Z84C0020VEC)
EPM9320LC84 CPLD 320 macrocells ..I've found a source where I can get these Cheap (£14.50 each)
64K SRAM (possibly UM61512 15ns DIP)
64K EEPROM W27C512-45 45ns EEPROM PLCC


The CPLD would generate all the glue logic and Video etc.. would have original video modes plus 560x192 (70x24 colour grid) possibly some bitmapped modes 320x192 (4 Colours) etc.

A low cost Sound Chip... SN76489, SAA1099 etc (I don't want to use ZX Spectrum Sound Chip, and or Graphics modes otherwise It would just be a ZX spectrum !)

The EPM9320 comes in PLCC84 (60 I/O lines) and be programmed with a USB Blaster cable these can be sourced from Digikey etc..but are eye-wateringly expensive!

The cost ??

Z80 CPU £1.50
64K SRAM £1.0
64K EEPROM £1.0
EPM9320 £14.50
Various other ICS £4.50
PCB ?? £20.0 to get manufactured (based on a Min quantity..)
Connectors etc £5.0

Roughly £50 ?? ............Now I've Just got to start breadboarding !!
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Putting a ZX81 onto a CPLD

Post by PokeMon »

Retro-Robert wrote: and be programmed with a USB Blaster cable these can be sourced from Digikey etc..but are eye-wateringly expensive!
You can get them for 10 EUR / USD /GBP easily on eBay.
These are mostly chinese but do work. ;)
http://www.ebay.de/itm/USB-Blaster-Prog ... SwEK9UEppf
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Re: Putting a ZX81 onto a CPLD

Post by Retro-Robert »

The USB Blasters are pretty Cheap and do work OK.. The EPM9320s from Digikey are £101 each !! I've got several CPLDs that I got Cheap anyhow!

EPM7128SLC84 (64 I/O lines, as fast as 7ns, 128 macrocells) would do the Job...but might as well go for something better... can be sourced for as little as $2.0 each
CY7C341B-xx (35ns or 25ns speeds,192 macrocells) Can be sourced for as little as $5.0 each , though could be argued that they are obsolete !
EPM9320LC84-10 10ns , 320 macrocells can be got for as little as $20.0 !

Note the Z84C0020PECs , Z80s on ebay from China are Remarked old Z80s, though these usually work fine their speed ratings can vary wildly from 2.5MHz to 8MHz ! That's probably why they are so cheap ! The Z84C0020VECs PLCC44 are genuine I believe!
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Putting a ZX81 onto a CPLD

Post by Paul »

Retro-Robert wrote: Note the Z84C0020PECs , Z80s on ebay from China are Remarked old Z80s, though these usually work fine their speed ratings can vary wildly from 2.5MHz to 8MHz ! That's probably why they are so cheap ! The Z84C0020VECs PLCC44 are genuine I believe!
I bought some of the the Z84C0020PECs and got new stuff. The pins as shiney as possible, run great at 20MHz and stay cool.
Far better than the original Z80A CPUs from Zilog, SGS etc. that were sold in the eighties.
I guess as allways it depends on where you buy them and where the seller gets the supplies from. I guess you can also have bad look.
I bought here:http://www.ebay.de/itm/10PCS-Z84C0020PE ... 43e1bc9356
I can recommend this seller. Not the cheapest but very reliable. I bought at least 100 times from them and was always happy.
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Putting a ZX81 onto a CPLD

Post by PokeMon »

I think this is a copy of Zilog's Z80 CPU and likely it is a NMOS version rather the CMOS version.
The NMOS version are rated for 8 MHz but should be able to use overclocked till 20 MHz.
There is an undocumented opcode which should indicate if it is a NMOS or CMOS version.

OUT (C),0 coded as $ED, $71 should output $00 for NMOS CPUs while it does output $FF on CMOS CPUs.
I had this issue when trying the "new" OUT (C),0 instruction on the ZXmore.
But it gives $FF (which should be normal for CMOS CPUs).

See here:
http://primrosebank.net/computers/mtx/p ... _fakes.htm

In 2004 Zilog decided to let chips produce in China and this may not have been the best decision made. :mrgreen:
http://www.eetimes.com/document.asp?doc_id=1270960
Post Reply