Close

CPLD Topics

A project log for HD6309 Singleboard Computer

Hitachi HD63C09 clocked at a blistering 3 MHz with a capacious 64K of RAM! Retroputing bliss...

tomcircuittomcircuit 01/28/2020 at 15:240 Comments

A couple of other questions that I've been asked revolve around programming the CPLD, which I'll try to summarize here.

CPLD Programming

Questions regarding the Altera EPM7128S seem to fall into two 'buckets': tooling, and issues with flashing.

CPLD Tooling

I use Altera (now Intel) Quartus v13 software, which can be downloaded from the Intel website here. You need to download the Quartus II Software, and the MAX 7000 device support package. Install these, and ensure that you can start Quartus II. Download the SBC Quartus project from the GitHub repository. You should be able to open the HD6309_glue_top project file (*.qpf) from Quartus. Compile the project (Processing -> Start Compilation) to build the output file.

Also part of "tooling" is some sort of JTAG interface between the host PC and the SBC PCB.  Search for an Altera USB Blaster and choose any model that supports 5V JTAG (most/all do). I use a nice unit from Terrasic which has been very reliable over the years, but certainly the lower-cost no-name units would probably work just as well.

CPLD Flashing

In general, CPLD flashing is either trivial, or impossible...

Normally, after connecting the USB blaster to the PC and the SBC, it's simply a matter of starting the programming feature from within Quartus (Tools -> Programmer). There's a little dance required to get the PC to see the USB Blaster via the [Hardware Setup] button, but then it's just a matter of clicking the [Auto Detect] button to see that the CPLD is able to communicate via JTAG. If it is, click [Start] and wait for the flashing to finish and you're good to go!

JTAG Issues

So...what if the Auto Detect fails? First, visually inspect your solder joints to be sure that you've got a good joint and no bridges to adjacent pins on the PLCC. Hopefully that's the issue.

If the solder joints look good, then we have to consider the CPLD itself. First off, it must be a EPM7128S... type. Examples: EPM7128SLC84, EPM7128SLI84. The S is critical, because it indicates that the device supports JTAG programming. Non S devices require the nearly-impossible-to-find-and-no-longer-supported Altera parallel programming hardware.

If you have an S device but it won't respond to Auto Detect, and you purchased it from anywhere other than a big distributor (e.g. eBay) then there's a very good chance that it's used and that the JTAG pins have been disabled. This is fairly common for CPLD's purchased from eBay sellers, and I'm sorry to tell you that there's (nearly) nothing you can do to remedy this. Re-enabling the JTAG pins requires the aforementioned Altera parallel programming equipment. Desolder the CPLD and throw it away...

My personal solution is a small PCB that I made with an 84 pin PLCC socket and connections to 5V and the USB blaster, to allow me to test the JTAG functionality of devices prior to me soldering them to a PCB...

Discussions