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:- A PCB. See below.
- Two 14-pin male pin headers for the connection to the C64
- Four 12-pin female pin headers, to install the GAL chips in. Some IC sockets work well too. For an IC sockets, the pin header to the C64 might obstruct placement, but many sockets have a channel in the middle that allow you to use them.
- Two GAL20V8B chips. The 25ns version is recommended, but 15ns is perfectly acceptable.
906114-01_20V8_L.jed | This is the fuse map that you should program into the left GAL. 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 GAL. 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. I am using GAL chips from professional electronic component traders. (AliExpress is fantastic, but too unreliable for resell purposes.)I am selling the PLA20V8 as a DIY soldering kit and also bare PCBs on Sell My Retro.
Please make your choice:
It is not mandatory to use Sell My Retro, if you don't like to create an account there. If you would like to
buy directly, fill in the following form:
If you fill in the form, I will send you a payment request via Paypal.
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. |
Frequently asked questions
Q: The ATF22V10 is still in production, why not use the ATF22V10?A: Indeed, Microchip still produce GAL chips. The ATF22V10 is potentially a good alternative and it was one of my candidate chips to use for my PLA. A disadvantage is that the original TL866 does not support this chip, you need the TL866-II to program it. The ATF22V10 is not available in 25ns. There exists an ATF22LV10C, which is available in 30ns, which could be used.
Official sources are often not as attractive as it looks at first sight. The price of the IC itself is not the problem, this is higher than on secondary markets, but still very reasonable. But in official channels often require a minimum order value. They then add a ton of packing material and ship by a courier that you pay at international rates. Everything included, buying only a few chips from official sources can become quite costly.
If we look in the secondary market, wether we look at professional IC traders, or Chinese web stores, nobody stocks the ATF22LV10C. You can indeed order it in any quantity from Microchip, but you aren't going to find much stock elsewhere. It is a rather rare part. In contrast, there is a huge supply from all directions of the GAL20V8B, this is a really common part that both professional IC traders and Chinese webstores can deliver in quanitity.
Therefore all things considered, the GAL20V8B was a better choice for this PLA.
Q: What about a new PLA for the assy 250469?
A: There is no demand for one. The HMOS chipset used on assy 250469 is very reliable, these boards are often compared with tanks: They are indestructable. Should you have a broken PLA on a board like this, it is still rather easy to find an original 251715-01 PLA. Ultimately, any chip will need replacement, and should there be a need, we can make a new PLA for this board. GAL technology can be part of that. For the forseeable future, this would a very bad project to spend time on, there are chips with a far worse shortages.
Q: Is it possible to recreate the Commodore 128 PLA using the same approach?
A: In all likelyhood, yes. The Commodore 128 PLA is a lot more complex than the Commodore 64 PLA, and not completely reverse engineered yet, so some work work be required. Like the assy 250469 PLA, the Commodore 128 PLA is very reliable and because of the low failure rate, I do not believe the community has a need for a Commodore 128 PLA at the moment.
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:(C) 2020 by Daniël Mantione