S100 Computers

Home S-100 Boards History New Boards Software Boards For Sale
Forum Other Web Sites News Index    
 
Introduction to CPLDs and WINCUPL
In the late 1970's "Complex Programmable Logic Devices" (CPLD) chips started to appear that contained reconfigurable digital circuits more powerful than GALs. As with GAL's, a CPLD device has an undefined function at the time of manufacture. Before the CPLD could be used in a circuit it had to be "burned" or programmed, much like a GAL, in fact CPLD's can be viewed as just larger GALs with many more pins.  Unlike the GAL CPLD's usually have 4 pins set aside to program/reprogram the chip on the board.  Also the programming language/circuits could be considerably more complex and sophisticated.

The ATM 1508 CPLD
There are many types of CPLD's available today.  Very common are the Atmel ATF 1504AS and ATF 1508AS CPLD's.   The first is usually made as a 44 pin PLCC pin package. The second as a 84 pin PLCC package.  Here is what the ATF 1508 chip looks like:-
   
1508 Picture 1508 Pinout
  
other package formats are also available.   We will normally use the very useful and flexible 1508AS chip.
 
A few points to keep in mind with this chip. 
1. It has 128 Microcells which can have up to 40 product terms each.
2. The chip is capable of very high speed operation (125MHz), is TTL compatible, able to sink 12 milli-amps per output pin.
3. The chip can be reprogrammed thousands of times and is claimed to have up to 20 years of data retention.
4. 3.3 and 5.0V I/O operations are possible.
5. The chip has up to 96 bi-directional I/O pins  and 3 dedicated input pins for clock signals.
6. All external and internal signals are global to all equations.


The ATF1508AS are typically used as in-system programmed devices utilizing 4 pins on the chip to do so. These are usually brought out to a "JTAG" socket on a board.  It typically takes less than 1 minute to "burn" a chip using the  JTAG socket.  There are many commercial CPLD burners available.  Unfortunately the Wellon V290 GAL/PROM burner we normally use to burn GAL's cannot be used to program these chips.  I like the one from Rockfield Research Inc., their "JTAG04" unit.   It connects to a PC USB port and your JTAG socket on the S100 board.  The Windows program accepts a .JED file from which the ATF1508 is burned.  Here is a picture of the unit.  While debugging a board you simply leave the unit connected and burn, modify, re-burn your CPLD chip from your PC until you have it running correctly.

Another good programmer (for $60), can be obtained from the Atmel web site  here.  It also connects via a USB port.
  
  Rockville Unit
   
PROGRAMMING CPLD's
To program these CPLD's we use a more sophisticated language than the simple PALASM language we use for GALs.  Fortunately Atmel supplies a complete Windows IDE programming interface called Wincupl to do this.  It is a "C" style format language.  If you are familiar with PALASM you should have no trouble getting started.  Here for example is the code to generate the A0 and A1 address lines from the 80386 signals BE0*, BE1*, BE2* and BE3*:-

mA1 =  mBE0 & mBE1;                /* Note these signals are latched by U75 */

mA0 =  (mBE0 & !mBE1 & !mBE2)
      #(mBE0 & !mBE1 &  mBE2)
      #(mBE0 &  mBE1 &  mBE2);


LsXTRQ.d = (mBE1 & mBE3)           /* Note 16 bit Request if these, otherwise 16 bit request */
          # mA0;

LsXTRQ.ckmux = ADS;                /* Latch S100 bus signal sXTRQ*. */
LsXTRQ.ar = !RES;


Documentation about the WinCUPL language can be obtained here.

As with GAL's what is nice about CPLDs  is that changing the circuit on a board is a trivial task. 

Also as with GALs when writing CPLD code you have to be take care to get active high and active low signals correct.  You can either define the pin signals as active HIGH or active LOW (with a "!" in front of the signal), If you then have an active LOW  in the equations you simply use the name without the "!". Using a "!" in the equation would be a double negative and flip its value to HIGH.

Alternatively you can define all pins as HIGH (no "!" anywhere in the pin definitions part)  and then in the equations use a "!" as needed.   The former case actually is more common,  though I often use and find the latter easier to understand.


A Simple CPLD Programming Motherboard.
All the S100Computers that utilize CPLDs do and will contain a "JTAG" socket to allow in the bus programming with the above simple 6 pin Rockford Programmer.  If there is room I will try in future boards,  to also include the more standard Atmel 10 pin "JTAG-A" socket. 

There can sometimes be an issue with re-programming old CPLD's from other boards in that depending on the last use of the chip there can be bus direction conflicts from the CPLD pins before the chip is reprogrammed within the bus.  For new chips this is not a problem.

For convenience I have built a small CPLD programming motherboard as shown here:-  
     
  CPLD Motherboard
    
This board will accommodate not only the ATF 1508 CPLD's but also  ATF 1502's and 1504's.  I believe this also covers the equivalent Altera Max 7000 chips.
There is also a socket for the Altera epm7064slc44 which is probably equivalent to the ATF 1502 (but different pinouts).
There is a socket for the epm7128slc84-6 and the epm7064slc44 and Xilinx XC9572 also.

Besides the Rockford Programmer you can use the more common Atmel 10 pin "JTAG-A" socket with for example the Kanda.com programmer.

Please note,  to date,  I have only used this board to program ATF 1508's with the Rockford unit.  The rest of the layout is based on suggestions from others, in particular the great help I got from David Mehaffy (Jedi Master).  The board is quite simple.

One final point.  Removing these PLCC chips from the socket is quite difficult. You must use a special two pronged chip removal tool. These are quite common for example Jameco #16766.
 
BUGs
The WinCUPL program is somewhat "delicate". While it is fast and gets the job done,  it seem to have a few internal glitches.  In particular it seems to be very particular as to the file name path of your .PLD code file. As best I can tell it has to be a sub-folder within the \WinCupl folder.  Also it seems sensitive to the overall path character length.  In the latter case it will appear to assemble correctly but the will be no .JED output file. It will not accept a space in the path name. Use an '_'.


Atmel WinCUPL Windows IDE Interface Download   (Vitasoft, 60008009)
WinCUPL users manual
ATF150x.zip   (Rockfield program to burn 1504's or 1508's)

CPLD Motherboard KICAD Files                (10/17/2016) 
CPLD Motherboard Gerber Files                (10/17/2016)
CPLD Programming Board Schematic
CPLD Programming Board Layout

CPLD Motherboard BOM.pdf                    (4/5/2018)   (Supplied by Rick Bromagem)  
CPLD Motherboard BOM.XLS                   (4/5/2018)   (Supplied by Rick Bromagem)  
CPLD Motherboard parts layout.pdf           (4/5/2018)   (Supplied by Rick Bromagem)  

This page was last modified on 09/10/2022