LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA simple counter wont count pulse generator

Capture.JPG

Here is the block diagram for my simple counter. I followed the NI implementing counters on an FPGA tutorial. I have a function generator, generating a 1 volt square wave at 1 kHz hooked up to my sc b68 connector block, and that hooked up to my USB 7856R FPGA. The program synthesizes, however, when I run it, the counter on the front panel doesn't proceed. I checked that there is a voltage running through the screw terminals on the connector block, and am unsure why its not counting each pulse.

0 Kudos
Message 1 of 5
(2,502 Views)

Short answer: you need a shift register on your count wire as well.

 

Long answer: have you tried FPGA Simulation? In the project window, right-click your FPGA Target, go to 'Select Execution Mode' > 'Simulation (Simulated IO)'. This will let you run your VI without compilation, and give you access to standard LabVIEW debugging tools like highlight execution. This should help you track down issues like this one much quicker in the future, as you'll be able to see that 0 is coming into the increment every time.

 

counter.pngedit

 

Edit: the 7856R's inputs are also configurable. Make sure you have the IO configured properly in the project for your input signal

7856 DI Levels.PNG

 

Cheers!

TJ G
Message 2 of 5
(2,480 Views)

Thank you so much for the reply! I fixed the shift register issue, and when I used the simulation mode, it counted it properly. However, I'm still having some issues with it counting from my function generator. As long as I have an alternating 0 to 1V pulse, that should fit within the logic family correct? And I have my function generator wired up to the DI0 port on the connector board, and that plugged into the Connector0 port on the FPGA. That should do it? Thanks again for all the help

0 Kudos
Message 3 of 5
(2,469 Views)

Hmm... I'm definitely more comfortable on the SW side, and it looks like you have everything set up properly there.

 

The default setting for DIO Logic Levels is 3.3V, which puts the minimum input voltage at 0.8 Volts - so a 1V signal should register just fine. How are the dip switches configured on your SCB68? Are you sure they're in Direct Feedthrough Mode?

 

I'll see if I can find an SCB-68 to try it out - no promises though 🙂

Cheers!

TJ G
0 Kudos
Message 4 of 5
(2,445 Views)

Sorry - I have an error in my previous post. You should be sure you're set to 1.2V logic levels for a 1V signal. If you're set to 3.3V, you'll likely not register a high, as the minimum is 2V.

Cheers!

TJ G
0 Kudos
Message 5 of 5
(2,438 Views)