Fun with CPLDs

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,326CR
I've wanted to learn about using CPLDs for a lot of years but never really got round to it until now. The main reason for me doing it now was that (despite still being advertised on a well-known US arcade parts supplier's website), the single chip VRA and SBC replacements for Pacman have been unavailable for years, and the big SBC daughterboard gets in the way of my Pacman high score save kit. And while I was at it I thought I might as well try to get the VRA done too. Both the big SBC and VRA boards are easily damaged by plugging them in the wrong way round, and they are very often missing when you get a Pacman/Ms Pacman PCB.

What's the SBC? It's the sync bus controller which interfaces external devices to the CPU.
What's the VRA? It's the VRAM addresser which determines the address to be accessed by the video output circuitry based on values of horizontal and vertical timing.

So a few days of learning, the CPLD carrier and JTAG interface board designed and delivered from China and just this week I've got it all to work.

I've built the carrier boards to work with Microchip/Atmel ATF15xxAS series 44-pin CPLDs. Attached are photos of the 2 boards built. Even though the CPLD itself is small, TQFP format, it's quite easy to hand-solder, just make sure you use a lot of flux then check with a magnifying glass for any shorts. The only other component shown is a Schottky diode for reverse-voltage protection, and there's space for an optional capacitor if needed.

SBC and VRA built top 0224.jpg SBC and VRA built bottom 0224.jpg

Turns out the VRA will fit into a ATF1502AS but the SBC is a bit too big and needs an ATF1504AS with its extra macrocells. Handily though they both have the same pinout so both fit on the carrier board.

So once the code is compiled it needs programming to the boards. That's where the 4 connections at the top of the carrier board are used, the JTAG interface. I designed another board to be the interface between the CPLD boards and the Microchip JTAG programmer - photo below (including 5V power supply that is needed). The CPLD board just plugs in and can be programmed/erased/reprogrammed until the final design works. You only need one JTAG interface board as it's reusable.

JTAG and PSU 0224.jpg

So that's about it, I now have a working Pacman board with high score save and my own replacement VRA and SBC boards. Photos below. showing the SBC (installed next to the CPU socket which is where the high score save kit plugs in) and Pacman running perfectly.

SBC installed 0224.jpg Pacman running 0224.jpg

The CPLD module can be used for recreating other custom chips that I may start experimenting with, along the same lines as the excellent work @NivagSwerdna has been doing with Konami customs.

I won't be selling assembled boards, but I will put up a separate for-sale thread for bare boards if anyone wants some to experiment with.
 

John Bennett

Senior Member
vacBacker
Feedback
10 (100%)
Credits
4,988CR
Yeah, those chips are cool - I used them when playing about doing a couple of Namco customs. Not a lot of storage, but at least they're 5V!
They were unobtainable for a couple of years with the chip shortage, but great if they're back now.

The one irritation was the shonkiness of the toolchains - having to get an ancient version of Quartus, work with equivalent (obsolete) IC names, output file converters etc. I can't even remember if I used a USB or Parallel programmer on an ancient laptop (hopefully the former).
So if you've worked out a slicker way of doing it all, that's neat :cool:
 

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,326CR
The one irritation was the shonkiness of the toolchains - having to get an ancient version of Quartus, work with equivalent (obsolete) IC names, output file converters etc. I can't even remember if I used a USB or Parallel programmer on an ancient laptop (hopefully the former).
So if you've worked out a slicker way of doing it all, that's neat :cool:
Prochip is good but AFAIK you can only get a 2 week licence before you have to fork out £600+ for 2 years.

I couldn't see me making good use of that kind of money so I did a crash course in WinCUPL which seems to do enough for my needs and generates code native to the ATF1502/4. Then programme the chip via JTAG using the Microchip version of the USB Blaster
 

Mc-Q

Active member
Credits
1,450CR
how is everybody programming these?

i looked at microchip and their programmer is £71 + tax,
the schematic shows a pretty expensive FTDI chip and i dont like that company anyway.

my "universal" programmer supports upto 750 and then the 2500 but not the 1500 series currently :(
 
Top