As you may recall, in my previous column I got us all set up to try out ChipScope. (See: Discovering FPGAs: The ChipScope Virtual Logic Analyzer.) Unfortunately, I'm hung up with a licensing issue at the moment. The Avnet site indicates that the Spartan 6 LX9 development board includes a device-locked ChipScope license, but my included license code didn't cover ChipScope.
Since my Spartan 6 LX9 development board was designed by Avnet, my exchange with Xilinx support pointed me at Avnet. The support conversation with Avnet is ongoing at the moment, so we'll all have to wait a bit to learn the outcome. Quick question -- has anyone else with the Spartan 6 LX9 board been able to get ChipScope running, or have you had a license problem too?
But all is not lost. There's no need to get depressed and bury our sorrows in two dozen donuts. Instead, let's just add a little something to the project. First, make an exact duplicate of the current project ("FND500count" from my column Driving a 7-Segment Display), but call the new version "FND500counter." We'll make this project just a wee bit more complicated while waiting for ChipScope. I want to add the ability to latch the 7-segment display, holding the value while the binary continues to count. We'll get back to ChipScope next week... hopefully.
If I were using discrete chips, I'd dig through my box of spare parts for a 7475 quad latch, and then drop this in between the four-bit binary counter and the 7-segment decoder (which we implemented in our Verilog code as a lookup table using a CASE statement).
These are really old chips, by the way. On the left is a 74193 4-bit binary counter. The 7475 quad latch is shown in the middle. On the right is a 7445 BCD to 7-segment decoder. (Of course, my counter is binary, not BCD, and the 7-segment display will show all 16 hex digits, but I could only find a BCD decoder chip in my treasure chest of goodies.)
Anyway, I'm going to take the push-on-push-off switch and use it to latch the 7-segment display. Lines 73, 74, and 75 of "7-segment count.v" used to look like this:
As we see, this causes the system to count only if the switch is on. Let's comment out line 74 as shown below. This will (a) leave the counter always counting, and (b) leave us free to use the switch to activate our latch.
So we don't want the binary count to stop, but we do want to be able to latch a value and hold it. My thinking is that there are two ways in which we can latch the digit display...
Next page >