Electronic – How to select pin functions on an EPM7128 CPLD

intel-fpgaprogrammable-logicquartus

I have some old Altera MAX EPM7128SLC84-15N CPLDs kicking around that I want to use to interface with 5v TTL logic.

Device pinout

If you look at the pinout, some of the pins have more than one function (eg. Pin 2 can be an input, output enable or global clock). How do you select which one it is and which one is it by default?

In Quartus II (I'm using version 13.0.1 Web Edition 32-bit), if I go to assignments -> device -> device and pin options everything is greyed out. Everything is greyed out in configuration as well. The only configuration scheme I get is "n/a in MAX7000S".

Dual use pin options

By the way, I'm aware that this is an obsolete part and there are modern 3.3V CMOS CPLDs that are compatible with 5V TTL logic. I have these parts in hand and would like to use them if at all possible.

Best Answer

The functionality of the pins is inferred from your code, rather than set directly. The pin names are telling you what that pin could be connected to internally within the FPGA.

enter image description here

The above diagram shows what INPUT/OE2/GLCK could be connected to. Note that while it looks like it's connected to everything at once, that is not the case.

To connect to the GCLK2 network you need to infer a clock by using the signal from that pin to drive the clock input of a register. Don't forget your timing constraints for this. To connect to the OE2 network use the signal to control the output enable on an IO block by either instantiating an IOB megafunction or writing the right code pattern to infer an IOB. To connect to the general purpose interconnect just feed to a logic block as normal.

For fun you could connect to all three and watch the synthesis tools have a fit as they try to decide what it is you want to do.