# 7segment display with PLD

Discussion in 'The Projects Forum' started by Cukrai, Nov 25, 2013.

1. ### Cukrai Thread Starter New Member

Nov 9, 2013
13
0
Hello!

I have a project at school.. We have to make 7 segment display to show numbers from 1 to 9 and letters A - F.. using PLD ATF16v8 and 74HC4060..
Actually i have already done this, but all i get is just all LED's lighted up..
I checked the counter (74HC4060) is it working with an oscilloscope and it gives input to PLD (state changing from low to high in different frequencies).. but i get only stable output voltage in every pin on PLD output pins.. So i assumed, that something might be wrong there maybe? also i checked the code twice and looks like it is okay.. Any ideas on this??

http://tinypic.com/r/11l4tc6/5 (diagram)

Code:

Pin 2 = A;
Pin 3 = B;
Pin 4 = C;
Pin 5 = D;

Pin 13 = gg;
Pin 14 = ff;
Pin 15 = ee;
Pin 16 = dd;
Pin 17 = cc;
Pin 18 = bb;
Pin 19 = aa;

aa = (A&!B&!C&!D) # (!A&!B&C&!D) # (A&!B&C&D) # (A&B&!C&D);
bb = (!A&B&C) # (A&B&D) # (!A&C&D) # (B&C&D) # (!A&B&!C&D);
cc = (!A&B&!C&!D) # (B&C&D) # (!A&C&D);
dd = (!A&!B&C&!D) # (A&!B&!C&!D) # (A&B&C) # (!A&B&!C&D);
ee = (A&!D) # (!B&C&!D) # (A&!B&!C);
ff = (B&!C&!D) # (A&!C&!D) # (A&B&!D) # (A&!B&C&D);
gg = (!B&!C&!D) # (A&B&C&!D) # (!A&!B&C&D);

Last edited: Nov 25, 2013
2. ### JohnInTX Moderator

Jun 26, 2012
3,322
1,662
You do not seem to have anything connected to OE/ (pin 11). Depending on the operating mode/programming, it should be connected to GND to enable the outputs?

3. ### Cukrai Thread Starter New Member

Nov 9, 2013
13
0
yeah, did that, just havent changed the diagram.. actually i was told to connect all the input pins that are not in used on PLD to ground.. and also pin 11.. i did that, however, the same result.. all LED's are on..

4. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,783
502
what are you using as the software to program the GAL?

As far as I remember you need to add /OE to the equtations.

Yes I programmed this a while ago into a small GAL for testing. But I don't have it setup right now for testing.

You should try the software simulator if there is one.

5. ### JohnInTX Moderator

Jun 26, 2012
3,322
1,662
OK. Presumably your counter is running at about 1.5Hz (per the datasheet formula). I did notice that it says that R8 should be way smaller than what you have. If the counter is running very fast, it will look like all the segments are on. Scope the outputs to be sure.

About the only other thing I can suggest is to be sure you are not in one of the registered modes that requires clocking on pin 1 to transfer the logic output to the pin.

6. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,783
502
I was thinking the software decides that based on the configuration you write, if it is static, it will configure the macro cell not to use registered mode.

These GALs are pretty much deprecated now, even if they still can be purchased. Lattice has phased them out a few years ago.

7. ### Cukrai Thread Starter New Member

Nov 9, 2013
13
0
i used WinCupl to write a code..

how i figured out, the problem is that on the output of PLD i get stable voltage to every LED and it is not changing.. those 4 input pins are changing in different frequences from low to high..

8. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,783
502
There is a simulator in WinCupl where you can program stimulation of the inputs and observe the waveforms on the output.

9. ### Cukrai Thread Starter New Member

Nov 9, 2013
13
0
tried to run simulator and got this error : "Error reading file. Error: 5"
but there is no errors after compiling..

10. ### JohnInTX Moderator

Jun 26, 2012
3,322
1,662
That's how I read it too. But it would be something to check as it fits the reported symptoms.

Welcome back, BTW.

11. ### takao21203 AAC Fanatic!

Apr 28, 2012
3,783
502
Thank you. I am happy to be able to contribute here in some areas where I have knowledge or where I just have used the technology myself some while ago.

Yes I guess the simulator does not work without some settings but it is possible to compile for the simulator, define a stimulus for the inputs, and record the output waveform (guess you need to select a timescale).

I don't have wincupl installed on my current laptop.

I'd suggest to load a few examples and see if they can be made working in the simulator and if not, post screenshots.