Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter and Display on NI-ELVIS and the Digital Electronics FPGA Board

The Digital Electronics FPGA Board for ELVIS alows students to program a Xilinx Spartan-III FPGA from LabVIEW, Xilinx ISE or a digital Multisim schematic.  This example takes advantage of some of the built in I/O, namely a bank of four push buttons and a two digit seven segment display.

 

The code (written in LabVIEW) allows you to push button 1 to add 1, push button 2 to add 5 or push button 3 to add 10 to a counter.  Holding down button 4 while pressing any of these subtracts the appropriate value.  The current value of the counter is displayed on the seven segment display.

 

The code achieves this by first waiting on a button press.  Once it detects this it adds the appropriate value to the internal counter (this exists as a shift register in LabVIEW).  Then we use a remainder and quotient function to divide by ten and give us the correct values for the first and second digit of the seven segment display.  We then select the correct LED combinations from a look up table (Stored as a 1D array in this code).  Finally we must wait for the button to be released to make sure we don't get multiple counts.

 

FPGA Code.png

 

The code is attached in LabVIEW 2010 (the latest version that supports this board).

 

Future Challenges

 

There are a couple of things that could be done to extend this:

 

  1. I am not proficient in VHDL.  I would be interested to see an equivalent design in that.
  2. We require remainder and quotient because we need to go between the binary and decimal domain.  A solution using BCD would not require this very large function (on an FPGA).  The caveat is that you would have to implement your own BCD adder.

 

If you do have a chance to take on these challenges do post your code, I would be very interested in seeing it.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com