The Devil is in the Details
Last time we figured out at a basic level what we need for the remote development cartridge. Now it’s time to fill in the details.
When using any programmable logic in a design, the first thing I like to do is actually write the logic that is required for the chip before I do anything else. This allows me to figure out the smallest (and cheapest) possible CPLD for the task and figure out all the signals required going in and out of the chip.
In this case the logic required is quite simple and will fit in the smallest MAX 3000A CPLD (the EPM3032). The only slight limitation I hit is the number of available pins. As it turned out, I needed 32 pins ideally, and normally the EPM3032 only has 30 available. I could get away with 30, but it wouldn’t be as optimal as I wanted.
JTAG? Do I Need That?
If you dig into the datasheet for the chip you will find that four pins are assigned to the JTAG in-circuit programming interface. During development you would normally have a JTAG connector on your PCB allowing you to reprogram your CPLD as you like during development. With older DIP packages this wasn’t an issue as you’d just remove your chip, put it in your programmer and program it. There were no reserved programming pins. But how does the chip know it is being programmed when its in the external programmer?
Danger, Danger, High Voltage!
As it turns out, to enter programming mode, a high voltage (above 5v, usually somewhere around 12v) has to be applied to one of the pins of the chip. This changes the use of some of the pins to enable them to be used for programming.
Great! Can I do that? It turns out, with a few caveats, you can. It’s possible to disable the JTAG interface on the EPM3032 and gain an extra four pins for your own uses. If you do this, to program the chip again you have to apply a high voltage (11v for this chip) to pin 1 to re-enable JTAG.
So we need to be careful that pin 1 is either not connected to anything that could be damaged by the high voltage, or protect anything that is connected with a diode. I have opted for the first choice and made sure the pin is not connected to any other logic — as long as the cartridge is unplugged when it’s programmed, we’re safe!
Push Me Pull You
There’s just one other thing to bare in mind when using the JTAG pins as I/O — Altera recommend having pull ups on TDI and TMS and a pull down on TCK. While this isn’t necessarily essential if there is just the EPM3032 in the JTAG chain (it has internal pull up and down resistors on chip), I like to be on the safe side. There’s nothing more frustrating than a temperamental programming connection. So just be careful when using pins that have pull up / down resistors that they make sense for your circuit, and that flapping the signals around during programming isn’t going to cause any trouble.
I say all this with great confidence, however I’ve never used the high voltage programming interface on the EPM3032 before and I can’t seem to find anyone on the web who has! So I’ve also made sure that its not the end of the world if somehow it doesn’t work.
Is That It?
We now have a lot more detail fleshed out about the components which are going onto the PCB, but before we start trying to lay anything out, we need to know what physical limitations there are on the PCB. As it has to plug into the ST’s cartridge port there will be quite a few dimensions which are going to be critical, so we’ll need to measure it up before we go any further.