11-15-2018 01:31 PM
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.
11-15-2018 03:32 PM - edited 11-15-2018 03:38 PM
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.
edit
Edit: the 7856R's inputs are also configurable. Make sure you have the IO configured properly in the project for your input signal
11-15-2018 05:35 PM
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
11-19-2018 02:46 PM
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 🙂
11-19-2018 03:54 PM
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.