Introduction

The Commodore 64 is a computer that refuses to die and decades after its introduction, its community is still going stong. Many computers still work fine, in contrast to generations of computers that came after it, and died too soon, Commodore 64 hardware is often in good shape. But that doesn't mean that these computers never fail, and repairing them is a common activity in the community. If you work with Commodore 64 hardware, you will know that a broken PLA is one of the most common defects. Especially PLAs that were produced in the years 1983 and 1984.

Because of this, the community has looked for replacements for this PLA. To my knowledge the PLA was first reverse engineered by Jens Schönfeld who later produced the SuperPLA. The first PLA replacements were done with EPROMs though, which were cheap and easy replacements. Replacing the PLA with an EPROM has quite a few disadvantages, known disdadvantages are timing, risk of bus contentions, switching noise and voltage levels. Therefore people started building better replacements based on modern logic devices.

Over the years many PLA replacements have appeared, such as the RealPLA, PLAnkton, PLAdvanced, Ultimate PLA and I'm sure I am missing a few. The art of building a PLA has grown increasing sophisticated and many of these PLAs are as good, if not better, than the original PLA.

However, if you regularily work on a C64, you will find that it is usefull to have a few spare PLAs in-house. And here it starts to hurt: There is labour involved in building a PLA replacement. In my opinion these alternative PLAs are sold for very reasonable prices if you consider the work done to create them. However, they are sold at prices that it is no longer fun to buy, say, 10 pieces to have on stock.

When facing this challange I concluded that I would need to build my own PLAs. I have looked at the reasons why current PLAs have the prices they have, and this is not that their creators are overcharging (not at all), but because they consist of multiple complex SMD components that require advanced soldering skills to produce them, and you may also need to a complex programmer.

I took a look which components were available at low prices (Chinese traders welcome) and you could program with commonly available tools. I saw a possibility, tried to build a PLA out of it, and succeeded. Ladies and gentlemen, let me introduce to you the PLA20V8!

The PLA20V8

The PLA20V8 is a PLA that consists of two GAL20V8B chips from Lattice Semiconductor. The GAL is a programmable logic chip that looks a lot like the original PLA: It has an AND array, followed by an OR array. Depending on the mode of the GAL the signal then can go through a flip-flop, which the PLA does not have, but this flip-flop is bypassed in the so called "simple" and "complex" modes, which makes the chips rather close to a PLA, perhaps the closest possible chips to a PLA you can get. We need two GALs, because we can't fit all the logic in a single GAL.

The GAL20V8B is no longer in production, however, availability of these chips is great. You can find them at low prices on internet marketplaces, including Chinese traders, so we can take advantage of low postage costs. Further, the GAL20V8B can be programmed with the TL866 programmer, which is low-cost as well, and many people in the retro computer community already have this programmer. The GAL20V8B is offered in DIP package, which means there is no complex soldering required. Just some through hole sockets and headers are needed, and a PCB. This means anyone can easily build this PLA himself, which removes labour out of the cost equation, thus allows for a really low-cost PLA.

I have designed a PCB, and the result of the PLA is as follows:

The PLA is a design from scratch based on Thomas Giesel's excellent "The C64 PLA dissected" document.

How good is it?

Pretty good. Allthough I was amining at low-cost easy to build PLA, rather than building the best PLA in the world, the PLA has until now passed everything thrown at it. Meanwhile a lot of C64 boards have been tested, with perfect results and a lot of C64 software and cartridges have been tested. In this regard it is relevant the GAL20V8B exists in three different speeds: 10ns, 15ns and 25ns. The 25ns version is the best choice from a theoretical point of view, but with a small adjustment (discussed below) I was able to get perfect results with 15ns chips as well. 10ns chips have not been tested, but are likely too fast.

Does Super-Zaxxon work?

Yes, it does work perfectly! Super-Zaxxon switches banks by means of accesses to the address lines of the C64 and as such, noise on the C64 address lines can cause undesired bank switches. This is a particuler concern for EPROMs, which are known to cause switching noises on address changes. The way the GAL20V8 works, with and AND array and an OR array just like the original PLA, this kind of noise is not expected and indeed, the cartridge works perfectly.

Can I use an alternate KERNAL?

Yes! An alternate KERNAL cartridge is a real PLA torture, because a KERNAL cartridge changes the C64 mode two times within a half cycle and thus likes a responsive PLA. This has been tested both with the 1541 Ultimate II and with the Easyflash 3 and works perfectly.

Does it work in all C64 mainboards?

Yes, except for the short board assy 250469 of course, because it uses a completely different type of chip. Assy 326298, 250407, 250425, 250466, 251103 (SX64) and C64 Reloaded MK1 have been tested. Assy 250441 and KU-14194HB have not been tested yet, but from what I know about these boards, I am confident about compatibility. Both PAL and NTSC tests have been done.

Does Epyx Fastload work?

Yes, it works fine. The Epyx Fastload cartridge is a rather questionable design that performs analog tricks on digital lines. In order for the Epyx Fastload to work, a PLA needs to have similar analog properties and be stable at the border voltage between 0 and 1. This is the case for the GAL20V8B.

How do I build it?

You need the following: For soldering it is best to start soldering the header to the C64 on the bottom of the PCB first. Then, solder the female headers or sockets. Then you can install the GAL chips, but you will need to program them first. For programming you can use the very popular TL866 programmer, which supports the GAL20V8B. I have the following files available for you:

906114-01_20V8_L.jed This is the fuse map that you should program into the left PLA. This file uses exactly the same product terms as the original PLA and the only difference with the original PLA will be that the IO and RAMCAS outputs are generated using multiple macrocells of the GALs (which is necessary to make the equations fit). This file is recommended if you use a 25ns GAL. For a 15ns GAL, this file may cause trouble depending on your specific C64 board.
906114-01_20V8_L_alt1.jed This is an alternative the fuse map that rewrites the IO product terms. By using one macrocell to compute wether the C64 is in Ultimax mode, the amount of product terms to compute the IO line almost halves. The result is that one macrocell in the GAL is freed up.
906114-01_20V8_L_alt2.jed This is an alternative the fuse map that rewrites the IO product terms in the same way as the previous file, but rather than leaving the freed up macrocell unused, it routes the CAS signal through this macrocell. This causes additional delay on the RAMCAS line. You will want to program this file if you are using a 15ns GAL, but it will work on a 25ns GAL as well.
906114-01_20V8_R.jed This is the fuse map that you should program into the right PLA. There are no variations on this file, you use it both for 25ns and 15ns GALs.

Measurements

It is possible to test a PLA in real-world tests, but it is also possible to do some measurements on several critical parameters. According to "The C64 Dissected", two key parameters are the CAS to CASRAM delay and the GAME to ROMH delay. The following measurements have been performed by Adrian Black. They have been measured at 200mhz using his logic analyzer, so the error is +/- 5ns. Threshold voltage is 1.3v (same as PLA dissected.). Adrian did use a 25ns GAL during the measurements. The left PLA did contain 906114-01_20V8_L.jed.

First CAS to CASRAM, the high to low transition:


In other words all three samples measure 20ns.

CAS to CASRAM, low to high transition:


Again, all three samples measured 20ns.

Game to ROMH delay, low to high:


One sample measured 15ns, the other two samples measured 10 ns.

Game to ROMH delay, high to low:


All three samples did measure 10ns.

High to low and low to high transitions, oscilloscope view:


My interpretation: The CAS to CASRAM delay value can be considered nice. It is on the fast side, but well within acceptable range. No compatibility problems are to be expected here. The GAME to ROMH delay is a bit faster than I would like and the PLA dissected document mentions this as a potential weakness for cartridge compatibility. No incompatible cartridges have been found yet and I doubt they exist. In order for this to become a problem, you would need to create a situation where the address lines are not yet stable when ROMH activates, and you do this by adding logic gates to the address lines but not on ROMH. However, because the address lines are valid before the PLA can activate ROMH, you would need to do quite a bit of processing on the address lines. I kind of doubt this exists. A fast GAME to ROMH delay may be beneficial for the stability of KERNAL replacement cartridges, because these cartridges change the C64 mode multiple times within a clock cycle.

The oscilloscope recordings of the transitions between low and high and the other way around look excellent. The high voltage level of slighly above 4V is not too far off from the original PLA and thus the analog properties of the PLA looking good.

Obtaining a PCB

You can order PCBs from me or produce them yourselves. I have uploaded the Gerber files to PCBWay, you can order the PCB here: PCBWay: Commodore 64 PLA Replacement. If you order from PCBWay, I will receive a small donation from PCBWay so you will support me that way. However, if you really want to manufacture the PCB somewhere else, I have enabled the Gerber download button on PCBWay, so you can download the Gerber files there and produce it at the PCB manufacturer of your choice.

Buying the PLA or just the PCB from me

If you don't want to source the different parts yourself, or just want to buy PCBs, from me personally, I also plan to sell PLAs and PCBs myself. However, I am not yet ready to start selling this, as I need to stock parts. I will be using GAL chips from professional electronic component traders. (AliExpress is fantastic, but too unreliable for resell purposes.)

At the moment I am thinking about offering a ready-to-solder package with all components (PCB, headers, sockets and pre-programmed GALs) for €8 and also a set of 5 bare PCBs for €20. Shipment costs will be €3 shipment costs within Europe, €5 world wide per order (not per PLA).

In case you are interrested in this, I would like to ask you to fill in the following form:

.
Name:
E-mail address:
How much PLA kits (ready to solder) are you interrested to buy:
How much PCBs (nothing else included) would you like to buy:
Do you have any other comments or requests:

As soon as I am ready to start selling, I will contact you then about the details. I will only use your information for this purpose and guard your data against any possible abuse In the future, I will move sales to Sellmyretro.

Source code

I have developed the configuration of the GAL chips in the CUPL language with Atmel Wincupl Wincupl is not the best software in the world, but there isn't much better available, and it was able do to the job. I have the following CUPL source code available:
906114-01_20V8.inc This include file contains the main CUPL code that implements the PLA. Defines control which file is generated.
906114-01_20V8_L.PLD This CUPL source file generates 906114-01_20V8_L.jed.
906114-01_20V8_L_alt1.PLD This CUPL source file generates 906114-01_20V8_L_alt1.jed.
906114-01_20V8_L_alt2.PLD This CUPL source file generates 906114-01_20V8_L_alt2.jed.
906114-01_20V8_R.PLD This CUPL source file generates 906114-01_20V8_R.jed.
20v8_82s100_adapter_v2_schema.pdf This is the electronic schematic of the adapter.

Contact

Do you have any questions or would you like to contact me for some other reason? You can e-mail me at daniel.mantione at freepascal dot org, or use the following form:
.
Name:
E-mail address:
Your message:

(C) 2020 by Daniël Mantione

Go to www.freepascal.org