How can I program GALs on a shoestring budget?

GALs may be obsolete technology, but they're still readily available, and are dirt cheap. For a hobbyist like myself, they're ideal for small projects that need something a little faster than a low cost microcontroller. But the catch is, programmers are expensive. The cheapest I can find is an unbranded device supplied by a chinese vendor and which costs over £30.

Unfortunately, the datasheets don't help. Lattice's datasheet for the GAL16V8 I plan to use just says there are commercial approved programmers available, and doesn't give any indication how those programmers actually work.

There are hobbyist designs available. There are a lot of recommendations out there for GALblast ... but GALblast has a few issues, not least of which is that it's designed to run from a PC with a parallel port (none of my current PCs have one any more), there doesn't seem to be a schematic available (just a PCB layout and assembly instructions), and the software designed to control it is a 16-bit Windows program (which won't run on my 64-bit system).

What other alternatives do I have? I'm happy to put together a system with a microcontroller and appropriate voltage converters (I presume that like 80s era EPROMs a GAL is programmed using a 12V supply? Even that isn't clear from the datasheets...), but I can't find any useful information how to actually perform the programming.

Edit

Doing a bit more searching, I found this project, which still depends on a parallel port and 16-bit software, but is at least better documented than GALblast, and more recent too, so it seems more likely that the designer will respond to questions about it. The name of that designer seems familiar too...

• First, tell about the problem you want to solve. GALs were the low-cost solution if you needed a small amount of programable logic with at max. 20ns propagation delay. That's now covered by CPLDs and FPGAs, which are even faster and less power-hungry. If you are way off the 20ns (say, 20µs), go with a $1 µC and an at max. 50 line assembler program and some lookup tables. Much much simpler. – Janka Jun 9 '18 at 17:15 • @Janka - I'm building a computer using 80s era technology, and need to build memory controllers, address decoders, etc. 20-50ns is approximately the response speed I need. – Jules Jun 9 '18 at 17:21 • Don't use GALs then, it's against the spirit. Use discrete logic and 27C512 EPROMs. Pin-compatible 28C512 Flash may come in handy for prototyping. – Janka Jun 9 '18 at 17:24 • I suspect that by the time you cobble together a "shoestring budget" programmer that you will spend more in parts than to purchase one of a slew of low cost GAL/SPI/EEPROM programmers available on eBay. – Michael Karas Jun 9 '18 at 17:50 • Just as a side comment, I often see folks talking about not having parallel ports so certain external interfaces and devices are closed off to them. This is not true. There are dozens of Parallel port PCIE cards if you have a slot available (even PCI if your PC is that old). They cost$10-20 and are fully compatible with both parallel and nibble mode. I've used lots of these cards in CNC development as parallel LinuxCNC is the easiest to implement ….never had a problem in any PC running Linux (or Windows). – Jack Creasey Jun 9 '18 at 18:51

For hobbyists the problem with GALs has been lack of programming documentation. Chip manufacturers have kept the algorithms a closely guarded secret and only released the information to manufacturers of 'approved' device programmers. This is understandable because the chips can be tricky to program and manufacturers want to ensure that it is done properly. The little information that is publicly available has come from a few old datasheets and reverse engineering.

Apart from GALblast and my ATFblast a few other DIY programmers have appeared over the years - including one by ChaN, an article in the May 1992 edition of Elektor magazine, and shareware projects for the Commodore Amiga and ZX Spectrum. Some of these include source code. But be warned - to fully understand the programming algorithms you will need to study it carefully.

A GAL is put into program verify mode by applying 12V to the 'edit' pin, but for actual programming it requires a higher voltage that varies depending on the manufacturer, type, and chip revision. Most GALs have pre-programmed bits that can be read out to tell the device programmer what voltage and timing to use.

Atmel's 'ATF' PLDs are the exception - they can be programmed and verified at 12V, and they don't have any bits to tell you what settings are required. Unfortunately the ATF22V10C has a different programming algorithm which is not supported by GALblast, and the lack of config bits causes GALblast to fail on the ATF16V8 and ATF20V8 too.

GALblast is probably your best bet for programming older GALs, provided that you can find a PC with a parallel port or install a PCI parallel port card. One slight problem is that the 16bit software doesn't work in Windows XP or later due to trying to access the printer port directly. Marinov Georgiy has has modified the software to work through a device driver. His version can be downloaded from here (I hope to incorporate his changes into my own ATFblast program soon).

If a parallel port is not available then you could port the software to a microcontroller board such as the Arduino Nano, and talk to it via the USB-serial port. I am currently working on a project which does just that (so far I have gotten it to read GAL and ATF chips, but haven't tried programming them yet). If you restrict the selection to ATF then you only need 5V and 12V. the 12V supply can be produced from 5V with a small boost regulator.

Advantages of ATF PLDs over other GALs include the single 12V programming voltage, that they are still in production, and the 'zero-power' variants draw much less static current (less than 1mA vs up to 130mA for a GAL22V10).