Putting a ZX81 onto a CPLD

Discussions about Sinclair ZX80 and ZX81 Hardware
lezanderson
Posts: 28
Joined: Tue May 17, 2016 1:03 pm

Re: Putting a ZX81 onto a CPLD

Post by lezanderson »

A Simple ZX80 design using an inexpensive CPLD.

Below is the parts list for a simple ZX80 homebrew microcomputer, based around a simple and cheap CPLD (EPM7128SLC84-15) . The CPLD having 60+ I/O Lines and 128 macroccells . These are just examples to give people ideas of what can b e done for theoretically little money.

Z80 CPU (preferably )Z80B or better) clock speed 3.58Mhz,7.16MHz or better
32K SRAM (HM62256, approx 100ns , or Fast SRAM UM61256 15ns)
32K EEPROM/EPROM (27C256 approx 100ns , 28HC256 45ns or so)
CPLD (EPM7128-15 15ns 60+ I/O Lines, PLCC84 package)
8255 PIO for CF card or PATA IDE harddrive ( instead of Tape recorder)
DS12887 RTC (Real Time Clock with SRAM)
SN76489 Cheap Sound Chip
7805 Voltage Regulator

All Glue logic of original ULA and any extra functionality would be done by the CPLD (EPM8128SLC84). Video output can be produced via a resistor network for VGA Monitor, if TV output is designed then DACs with NTSC,PAL composite encoder will be needed. Pyroelectroincs has a section on using an EPM7128 as a video VGA generator...see :

Costing
Z80………...…..$1.50
SRAM……...…..$1.0
EPROM…….…..$1.0
CPLD ……….....$2.0
8255…………....$1.50
DS12887………..$1.50
SN76489…….....$0.50
7804 …………...$0.25

** Prices based on items on eBay.com

Total Cost <$10 for ICs , should be possible to make with switches, IC sockets , miscellaneous stuff & PCB for about $50

A Simple ZX81 design using an inexpensive CPLD.

Below is the parts list for a simple ZX81 homebrew microcomputer, based around a simple and cheap CPLD (EPM7160SLC84-10) . The CPLD having 60+ I/O Lines and 160 macroccells .

Z84C0020PEC ….Z80 CPU 3.58Mhz,7.16MHz upto 20MHz **
64K SRAM (UM6512-15 15ns))
64K EEPROM (W27C512-45 45ns)
CPLD (EPM7160SLC-10 10ns 60+ I/O Lines, PLCC84 package)
8255 PIO for CF card or PATA IDE harddrive ( instead of Tape recorder)
DS12887 RTC (Real Time Clock with SRAM)
SN76489 Cheap Sound Chip
AY-3-8910 or YM2149 Sound Chip
7805 Voltage Regulator

**Genuine 20MHz CPU can be got here :
tk-electronics

Optional
Z84C9008VSC PLCC Z80 KIO (CTC,PIO,SIO)
AM9511 Maths FPU
MB8877+WD9216 Floppy disc controllers

All Glue logic of original ULA and any extra functionality would be done by the CPLD (EPM7160SLC84). EPM7xxxSLC84 CPLDs can be programmed using a cheap (JTAG) USB Blaster cable.

Costing
Z80………...…..$1.90
SRAM……...…..$2.20
EPROM…….…..$1.0
CPLD ……….....$12.50
8255…………....$1.50
DS12887………..$1.50
SN76489…….....$0.50
AY-3-8910……...$1.50
7804 …………...$0.25

** Prices based on items on eBay.com

Total Cost <$24 for ICs , should be possible to make with switches, IC sockets , miscellaneous stuff & PCB for about $65
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Re: Putting a ZX81 onto a CPLD

Post by Retro-Robert »

Which CPLD to choose Xlinix, Altera etc ?

I’ve been looking at Complex Programmable Logic Devices (CPLDs) and wondered which to choose ?? The Altera MAX ones look cheap and the USB Blaster cable is cheap ..But which is best, easiest to program etc ?? :?
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Putting a ZX81 onto a CPLD

Post by sirmorris »

Don't forget to factor in the tool chain. Xilinx tools are a bit easier on the beginner, I seem to remember.

The knock-off xilinx cables are also cheap. Or forget about the cable and program the chip with an arduino. If you have some microcontroller experience you can use the open source programming code for xilinx devices. None of my recent devices have a jtag header - all the CPLD programming is done in-place by the resident controller. Arguably a jtag header is useful early on, for emergencies, but later iterations tend to lose it. In a real emergency I'm fortunate that I can solder wires to pins relatively easily.

So xilinx for me.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Putting a ZX81 onto a CPLD

Post by PokeMon »

I use Altera and I like drawing schematics instead of VHDL language. Altera has equivalents for nearly all 74xx devices to drag in. No need to learn the programming language. Easy for beginners. And USB Blaster is cheap. I made an own programmer device for the PLCCs. If you can resist of a JTAG header, I don't think so. How would you program the CPLD/FPGA devices if the system is not coming up without a programmed device ? This depends on the project/implementation, I think.
Retro-Robert
Posts: 10
Joined: Thu May 12, 2016 11:22 am

Re: Putting a ZX81 onto a CPLD

Post by Retro-Robert »

I spotted an interesting Article in PyroElectro (PyroElectro.com) about using a CPLD (EPM7128SLC84) to generate a VGA video output :

http://www.pyroelectro.com/tutorials/fp ... index.html

I also spotted the software to program the Altera devices :

http://dl.altera.com/?edition=lite

But I suppose you have to try both Xilinx and Altera to figure out which is best..it's all a steep learning curve !
User avatar
Paul
Posts: 1523
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Putting a ZX81 onto a CPLD

Post by Paul »

I started with altera and switched to xilinx recently.
No big deal. With altera please make shure to use the correct version of software.
Newer Software doesn't support old chips. 13.0 is OK for EPM7128SLC for example. Also make shure to get the right chips.
With max7000 only the SLC variants of plcc can be programmed via jtag.
With max7000 you use either 44 pin or 84 pin plcc.
I use the XC9572XL in a VQG64 pin case which saves a little space on the pcb and has more IO pins than any 44 pin variant.
I'm missing this size with max7000 or max3000 devices from Altera.
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 did spot some cheapish CPLDs on eBay.com:

EPM7256SQC208-10....$7 each..Can be programmed with USB Blaster + JTAG (I Believe) has 256 Macrocells & 160 I/O lines,but is surface mount !
http://www.ebay.com/itm/Altera-IC-CPLD- ... SwcBhWbBeg

EPM7160SLC84....$14.50 each ..Can be programmed with USB Blaster + JTAG , has 160 Macrocells & 60 I/O lines PLCC84
http://www.ebay.com/itm/IC-EPM7160SLC84 ... Swcu5UMfMx

EPM9320LC84....$25.0 each..Can be programmed with USB Blaster + JTAG (I Believe ??) has 320 Macrocells & 60+ I/O lines . I actualy got some of these for $5.0 each from eBay.com !!
http://www.ebay.com/itm/1piece-IC-Chip- ... Swxp9W~PdX

EPM7128SLC84-xx lots of these on eBay.com about $2.0 each can be programmed with USB Cable / JTAG.

ATF1508AS-10JU84..Xiliinx CPLD....PLCC84 ..$8.0 each or so ?
http://www.ebay.com/itm/NEW-1PCS-ATMEL- ... SwEzxYPRVZ

EPM7512xxx Surface mount...512 Macrocells 100+ i/O lines... I got some of these for $7.50 from China for a ZX Spectrum ULA project I was thinking of doing!

Looked on Digikey and stuff and a lot of these are obsolete as they're switching to lower voltages, but what they had were very very expensive.. The EPM9320LC84 were £110 !!
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 »

There is no "one size fits all". For each application, determine:
  • Whether you need 5V tolerance on I/O pins. 5V tolerant devices will need 3.3V power (or less), but I/O's can be hooked up directly. For non-5V tolerant devices, signals from a 5V system will need a voltage shifter (IC), series resistor / diode / whatever on each I/O pin. 5V tolerant or not limits what device families can be used.
  • Number of I/O pins needed. If chosen device has fewer, you can't complete design or need ugly workarounds.
  • How many macrocells / LE's or whatever your design needs (roughly, this may involve some guesswork or trial-and-error). :idea: Note that you can install development software, pick a device, do a design, and see if it fits without buying any device or programming hardware.
  • Package / physical size. PLCC vs. QFP, 0.5 / 0.8 / 1.27 mm pitch between pins etc. Pick what you can handle soldering-wise. ;)
For each device that may suit those needs, check:
  • Still produced? Or only remaining stocks / new old stock / eBay etc? Cost per device? Alternate suppliers?
  • In-system programmable? (eg. via JTAG).
  • What programming hardware is needed, and what does this cost?
  • Which (versions of) which development software supports those devices, using that programming hardware? Simply downloading the latest is waste of time if support for an old device you chose, was removed from that version. A cheap parallel port programmer is useless if supported software does USB programmers only.
  • Which operating system(s) can run those version(s) of the development software?
  • What hardware do you have to run that OS and that version of development software on, and connect that programming hardware to?
Basically you need to find a working combo for which you can 'check all the above boxes'. Mostly this involves a lot of reading docs, and perhaps asking a question here & there. DO NOT exclude any vendor or device option in advance! Look around - Xilinx & Altera are the most popular but not the only options. Software issues can be troublesome, but software is flexible... :P
Paul wrote: Thu Apr 20, 2017 2:49 pm I use the XC9572XL in a VQG64 pin case which saves a little space on the pcb and has more IO pins than any 44 pin variant.
I'm missing this size with max7000 or max3000 devices from Altera.
+1. 44 pin PLCC or QFP is easy to find with ~34 I/O's. But if you need more I/O's, you're looking at 84+ pin devices quickly. It's a shame there aren't more devices in between there, a small QFP with ~50 I/O's is a nice option to have.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Putting a ZX81 onto a CPLD

Post by PokeMon »

Or in simple words: Hardware development is not an easy step. :P
andykarpov
Posts: 1
Joined: Fri May 12, 2017 11:24 pm

Re: Putting a ZX81 onto a CPLD

Post by andykarpov »

There are similar projects already exists, for example: Speccy2007, based on Altera CPLD EPM7128 + Z80 + SRAM + some buffers + AVR (add support to load and save taps and snapshots from SD card).

One of the variation is here: https://github.com/jacksn/speccy2007-128k-CMF

I've just started to develop my own implementation without AVR: https://github.com/andykarpov/karabas-128/
The main goal is to develop a cheap replacement of original Spectrum 48k board with my CPLD based clone.
Post Reply