0

I am working on a Project about making a stop watch. In order to do that I must use seperate digits on the 7-segment display. However, when I try it, all the digits act the same. I used the following code for the constraint.

set_property PACKAGE_PIN W7 [get_ports {clk_out[6]}] 
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[6]}] 
set_property PACKAGE_PIN W6 [get_ports {clk_out[5]}]  
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[5]}] 
set_property PACKAGE_PIN U8 [get_ports {clk_out[4]}] 
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[4]}] 
set_property PACKAGE_PIN V8 [get_ports {clk_out[3]}]  
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[3]}] 
set_property PACKAGE_PIN U5 [get_ports {clk_out[2]}] 
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[2]}] 
set_property PACKAGE_PIN V5 [get_ports {clk_out[1]}] 
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[1]}]  
set_property PACKAGE_PIN U7 [get_ports {clk_out[0]}] 
set_property IOSTANDARD LVCMOS33 [get_ports {clk_out[0]}] 

How can I use seperate digits? It would be really helpful if you explain it to me by an example. Thanks in advance.

user6210457
  • 397
  • 1
  • 7
  • 22
  • 1
    is it a multiplexed display? If so, read up how to drive multiplexed displays. –  Apr 15 '16 at 21:56
  • Is it? I don't know. I want to use more than one digit differently than the each other. – user6210457 Apr 15 '16 at 22:03
  • 1
    [Basys 3 FPGA Board Reference Manual](https://reference.digilentinc.com/_media/basys3:basys3_rm.pdf) Pages 15, 16 and 17. Notice the Anodes shown in the figure at the top of Page 15. –  Apr 15 '16 at 22:53
  • Aren't they for just having it or not? I want something like open these leds on the left, these on the right. How can I do that? I want to do a two digit counter. Could you give me some tips? – user6210457 Apr 15 '16 at 23:01
  • The solution is already well described in the [Basys 3 FPGA Board Reference Manual](https://reference.digilentinc.com/_media/basys3:basys3_rm.pdf) in Section 8.1. It mentions how to drive the anodes, specifies the toggle frequency, and also gives a timing diagram. If you need more help, then please update your question with the code you have so far. And also give an example output, so that, we understand what you are trying to achieve. – Martin Zabel Apr 19 '16 at 07:35

2 Answers2

0

@Brian Drummond and @user1155120 have really answered your question. The display is time multiplexed. You need to repeat this sequence over and over again so fast that the human eye cannot perceive that you are only driving one digit at once:

  • enable U2 and drive the 7-segment outputs for the units column;
  • then enable U4 and drive the 7-segment outputs for the tens column;
  • then enable V4 and drive the 7-segment outputs for the hundreds column;
  • then enable W4 and drive the 7-segment outputs for the thousands column.

So, you'll need some VHDL code that drives U2 then U4 then V4 then W4 then U2 etc and some other VHDL code that drives the 7-segment outputs appropriately for each digit.

Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44
  • 1
    That will lead to (possibly faint) ghosting. If it's visible, then disable all anodes, drive the cathodes, then enable the appropriate anode... –  Apr 16 '16 at 12:26
0

I would start first with familiarising with data sheet for 7sgment display. What you need to do is run each digit separately(separate counter for example for each digit with overflow curry to next counter), then make state machine that oscillates at list 60hz x number of displays = x. So you will have two clocks one that counts your time and other which runs at list 60hz per digit on display.

Your stat machine should then have state for each digit (activate correct pins out) and preferable "others" state which would go back to first state if unreachable state would be entered by error.

This should get you started.

Regards, Sebastian

P.S here is similar question to yours but for timer : https://stackoverflow.com/questions/36033688/if-statement-with-two-unsigned-conditions-in-vhdl-not-working

Community
  • 1
  • 1
Seb.Sz
  • 25
  • 6