Using 5V Programmable Logic Here In The 2020s

Do you speak GAL? [Peterzieba] does, and has pulled together a collection of documents and tools so that you can too. There’s a dividing line in electronic engineering education, between those who were taught about FPGAs, and those who weren’t. Blurring that line slightly is gate array logic (GAL). These devices were a preceursor to the FPGA, with a much simpler structure, and usually in those days UV-erasable in the same manner as an EPROM. And oddly enough, they, or at least their successor compatible parts, are still available, and as handy DIP devices that talk to 5 volt logic.

The guide goes into detail about the parts, the terminology surrounding them, and the CUPL language which raises a few memories for us. There are several possible workflows, including for those not faint of heart, the possibility of writing a fusemap by hand. We’re impressed by that one.

If these devices interest you, our colleague Bil Herd wrote a two-part guide (part one, and part two) which should answer your questions.

Thanks [Bjonnh] for the tip!

Featured image: “Commodore Amiga 1000 – sub board – Texas Instruments PAL16L8ACN-0126” by Raimond Spekking

Programming PALs In 2021

The [IMSAI Guy] has posted a follow-up video with all the details of how he programs GAL22V10 chips in the modern era. We noted that this was missing from his stepper motor project a few days ago, and before we could even ask him, he answered. And no, you won’t have to dig that old Intel 486 DX2-66 out of the closet and search eBay for working floppy drives. It turns out the answer is easier than you’d think.

Microchip now owns WinCUPL through its acquisition of Atmel in 2016, and offers WinCUPL as a free download from the Microchip website. This runs only in Windows, although some users report success running under Wine on Linux. This tool will compile the design, but you still need to program the chip. If you’ve done any EEPROM programming lately, chances are you have one of the TL866A MiniPros laying around — this programmer can handle CPLDs, PALs, and GALS as well as EEPROMS. [IMSAI Guy] walks you through the programming procedure, and if you’ve programmed EEPROMs before, the process will be familiar.

For those who prefer the Linux or Mac environment, there are some alternatives. We’ve seen GALasm used on several projects such as [Ken Yap]’s 8085 Minimax. The GitHub repository for GALasm states that commercial use is strictly prohibited, so take note if this applies to your project. As for controlling the TL866A, there is a Linux port called minipro available on GitLab. The remaining hurdle if you want to experiment with these programmable logic chips it to actually get them — many are now obsolete. But it looks like you can still buy Lattice and Microchip (Atmel) ones from various sources. Happy Programming.

Continue reading “Programming PALs In 2021”

Stepper Motors Quick And Simple

If you want a simple and easy introduction to stepper motors, check out the [IMSAI Guy]’s short video where he designs a very basic stepper motor controller and packs in a lot of quick lessons along the way. (Embedded below.)

He first goes over the fundamentals of a stepper motor in a practical, hands-on approach, and also shows us how to ring out the connections if the pinout is unknown. Next he demonstrates stepping the motor manually and then makes a simple FET driver circuit. Just when you’re expecting a small microcontroller to appear, the [IMSAI Guy] instead digs deep into his junk box and explains how to drive the motor with a 22V10 GAL (an electrically erasable PAL) and a 555 timer module. Based on a clearly-explained logic table for driving the coils, a sneaky way to introduce Karnaugh maps, he proceeds to write the output equations in WinCUPL.

Mature Readers will recall the “Happy PAL” Character

WinCUPL is the modern version of CUPL (Compiler for Universal Programmable Logic) originally written by a company called Assisted Technology, now owned by Altium. CUPL and peers like PALASM from Monolithic Memories, Inc. (MMI) and ABEL from Data I/O Corporation were basic Hardware Description Languages specifically designed for PALs, GALs, and CPLDs. PALs were small arrays of logic gates with fusible interconnections, and your design is “burned” into the fuses much like a (EE)PROM. When designing with PALs, you could clearly visualize the connections in your mind, something that has since been remedied by the advent of modern FPGAs.

Alas, he cuts out the part where the source code is compiled and the 22V10 is programmed, and jumps directly into testing the circuit on a breadboard. Spoiler alert — it does work. Zooming in close and squinting, the nifty 555 timer breadboard module that he points out is called a TP353, which you can find from your favorite online supplier.

There is a lot to learn in this tutorial, and the [IMSAI Guy] does a great job at making the subject approachable to hobbyists and novices. We also covered another of his tutorials a couple of weeks ago on image sensors. Thanks to [itsevilbert] for the tip.

Continue reading “Stepper Motors Quick And Simple”

Hackaday Prize Entry: Very, Very Small Logic

Despite the existence of FPGAs and CPLDs, there’s still a necessity for very small programmable logic devices. GALs, PALs, and other old tech just won’t cut it, though, and so we are left with a new generation of programmable devices that aren’t microcontrollers or CPUs. The GreenPAC from Silego fill this niche quite nicely, with the ability to implement counters, ADCs, logic glue, level shifting, and comparators in a single chip. For any homebrew electronics tinkerer, these devices have one very obvious problem: they’re really, really small. The smallest GreenPAC device has 12 pins stuffed into a 1.6 x 1.6mm QFN package. You’re not hand soldering this thing.

For [Nick Johnson]’s Hackaday Prize entry, he’s taking these small programmable logic chips and making it easy to create your own custom ICs. Basically, it’s a breakout board for GreenPAC devices that stuffs these tiny chips onto a much more reasonable DIP package.

Breakouts aren’t enough, and to program these small chips, [Nick] is also building a board based on an ARM microcontroller. With USB input, a way to generate the 7.5V used for programming, and a breadboard friendly format, this programmer will tell these tiny chips what to do.

Not many people are building stuff with PALs and GALs anymore, but there are still a lot of work that can be done with small programmable chips. There’s certainly a place for tiny programmable logic chips like this, and anything that gets them in to the hands of more people is okay in our book.


The 2015 Hackaday Prize is sponsored by:

New Part Day: Modern PALs

Back in the bad old days, if you needed a little bit of custom logic you would whip out a tiny chip known as a PAL. A Programmable Logic Array is just what it sounds like and is the forerunner of modern, unsolderable CPLDs and FPGAs.

PALs and GALs have died off, left to the wastes of the Jameco warehouse, and now it seems the only programmable logic you can buy are huge, 100-pin monstrosities. [Nick] at Arachnid Labs was working on his Tsunami signal generator when a user asked if they could add just one more feature: a programmable divider to count 256 iterations of a clock. This is the perfect application for dumb logic, but if you’re looking for a part that’s not recommended for new designs, you only need to look to old programmable logic.

Enter the Greenpak. [Nick] had a dev kit for these ‘modern PALs’ sitting around and decided to give it a go. They’re small – they max out at 20 pins – but there are a few features that make it a little more interesting than a simple array of AND and OR gates. The Greenpak3 features analog comparators, look-up tables, RC oscillators, counters, and GPIO that will work well enough as circuit glue. They also work at 5V, something you’re just not going to find in more complex programmable logic.

These tiny chips are programmed in a graphical IDE, but the datasheet (PDF) includes full documentation for the bitstream; someone needs to write a Verilog or VHDL compiler for it soon. The one downside with these chips is that they’re tiny; 0.4mm pitch QFN packages. If you can solder that, you’re too good at soldering.

A Graphics Card For A Homebrew Computer

One of [aepharta]’s ‘before I die’ projects is a homebrew computer. Not just any computer, mind you, but a fabulous Z80 machine, complete with video out. HDMI and DisplayPort would require far too much of this tiny, 80s-era computer, and it’s getting hard to buy a composite monitor. This meant it was time to build a VGA video card from some parts salvaged from old equipment.

When it comes to ancient computers, VGA has fairly demanding requirements; the slowest standard pixel clock is 25.175 MHz, an order of magnitude faster than the CPU clock in early 80s computers. Memory is also an issue, with a 640×480, 4-color image requiring 153600 bytes, or about a quarter of the 640k ‘that should be enough for anybody.’

To cut down on the memory requirements and make everything a nice round in base-2 numbers, [aepharta] decided on a resolution of 512×384. This means about 100k of memory would be required when using 16 colors, and only about 24 kB for monochrome.

The circuit was built from some old programmable logic ICs pulled from a Cisco router. The circuit could have been built from discrete logic chips, but this was much, much simpler. Wiring everything up, [aepharta] got the timing right and was eventually able to put an image on a screen.

After a few minutes, though, the image started wobbling. [aepharta] put his finger on one of the GALs and noticed it was exceptionally hot. A heatsink stopped the wobbling for a few minutes, and a fan stopped it completely. Yes, it’s a 1980s-era graphics card that requires a fan. The card draws about 3W, or about two percent of a modern, high-end graphics card.

Reverse Engineering Programmable Logic

DickSmith_VZ300_System_s1

Despite what the cool kids are doing over on Hackaday Projects, the vast majority of vintage computers used some form of programmable logic for memory control, address decoding, and all that other stuff that can be done with just a few logic chips. It’s a great way to design a product for production, but what happens when the programmable chips go bad after 30 years?

[Clockmeister] got his hands on a Dick Smith VZ300 computer (a clone of the VTech Laser 310) with two broken 40-pin custom chips. After going through the schematics and theory of operation for this compy, he recreated the custom chips in 74 series logic.

The Dick Smith VZ300 is a fairly standard piece of equipment from 1985 – a Z80 CPU, 16k RAM, upgradable to 64k, a tape drive, and 32×16 character, 8 color display. Inside this computer are two 40-pin chips that are responsable for video buffering and VRAM control, keyboard and cassette I/O, video timing, and the monophonic speaker decoding. Both of these chips failed, and spares are unavailable, apart from scavenging them from another working unit.

After careful study, [Clockmeister] recreated the circuits inside these chip with 74 series logic chips. The new circuit was built on a board that plugs directly into the empty 40-pin sockets. Everything in this rehabbed computer works, so we’re just chalking this up as another reason why designing new retrocomputers with programmable logic is a dumb idea. Great for a product, but not for a one-off.

Image source