Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use each display of 7-seg display for different purpose? ( Spartan 3 )

Status
Not open for further replies.

Hammer111

Junior Member level 3
Joined
Jun 14, 2006
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,587
Hi guys

I need help with 7 seg display. How can I use 2 displays out of 4 for different purpose. I know how to use all displays but only for one purpose.

I need to count to 9 at each of 2 displays but at different speed.

First display should count with speed of 1/10 sec and second should count every second.
 

Re: Spartan 3 display

Usually you use the 7-segment display in a multiplexed manner. That is, you have a demux to select what the active digit of the display is. Your refresh frequency should be high enough so as to prevent the effect of watching the display blinking.
The other part, this is what you display on each digit is just part of your logic. You will need two counters and another control FSM so that each 1/10 of second you increment your first counter whose output you will convert to BCD and display on 2 digits, and when a second has elapsed you increment both your first and second counter, and the output of the second counter you will also convert to BCD and display on the other 2 digits of the LED 7-segment display.

What you need is a clock actually, only that it will run at different frequency. You can browse the net for examples on this. I am pretty sure you will find plenty of examples, and hopefully, one implemented on the Spartan-3 board.
If not, let me know.
 

Spartan 3 display

Do you really need independent count rates? Maybe you only need a two-digit display that counts 00 to 99 with 0.1 second count rate.

Are you using the popular Xilinx/Digilent Spartan-3 Starter Kit? Someone may have example code.
 

Spartan 3 display

Hi,
I have done the multiplexing .. I'll send you the code.. with division of 1 sec..if your using Spartan-3 Starter Kit.

Regards.
 

Re: Spartan 3 display

So actually I must do one or two loops that will refresh both or each display :?:

If I write in one loop anode<="1101"
and in the other loop anode<="1110"
one loop will turn off the second display and opposite.

Also I must not write anode<="1100" because it will turn on both displays at the same time and data I send will be on both displays (eg. seconds)
 

Re: Spartan 3 display

Tell me, are you using Spartan-3 starter kit?
Just to be sure. Give me some time and I'll try to send you the vhdl code for what you're chronometer. I already have code for the multiplexed 7-segment display.
Let me find it and I'll send it to you by weekend. Is that OK?

Please provide me your e-mail. You can send me email to mendozaulises78(at)gmail.com

Regards,

Ulises
 

Re: Spartan 3 display

So actually I must do one or two loops that will refresh both or each display

If I write in one loop anode<="1101"
and in the other loop anode<="1110"
one loop will turn off the second display and opposite.

Also I must not write anode<="1100" because it will turn on both displays at the same time and data I send will be on both displays (eg. seconds).


You should only enable one digit at a time, since they share the same control lines, that's why you have to multiplex.
 

Re: Spartan 3 display

Hammer111 said:
Hi guys

I need help with 7 seg display. How can I use 2 displays out of 4 for different purpose. I know how to use all displays but only for one purpose.

I need to count to 9 at each of 2 displays but at different speed.

First display should count with speed of 1/10 sec and second should count every second.


You canuse 2 displays out of 4 for different purpose by editing the UCF files manually or by PACE editor.

You need to count to 9 at each of 2 displays but at different speed. For this you will have to write two additional counters for counting at different speeds.
NOTE of general error: The display will be dim with no counting if they are counting too fast!
 

Spartan 3 display

Hi,
The code for multiplexing 7-seg display:

Process(clk1KHZ)
variable c: integer range 0 to 3;
begin
If clk1KHZ'event and clk1KHZ='1' then

Added after 5 minutes:

Sorry..this the complete code:

Process(clk1KHZ)
variable c: integer range 0 to 3;
begin
If clk1KHZ'event and clk1KHZ='1' then
if c= 3 then
c:=0;
else
c:=c+1;
end if;

case c is when
when 0 => anode<="0111";
cathode<=dig1;
when 1 => anode<="1011";
cathode<=dig2;
when 2 => anode<="1101";
cathode<=dig3;
when 3 => anode<="1110";
cathode<=dig4;
end case;
end if;
end process;

----
where dig1, dig2, dig3, and dig4 are signals.

regards.

Added after 2 minutes:

please check the syntax error...remove when from (case c is)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top