0
\$\begingroup\$

I am trying to use TCS3200 color sensor for my project with De0 nano FPGA board. The output of TCS3200 is a square waveform and i am confused how to use that waveform for a particular task.

I searched over Google and found out that i have to measure the frequency of the output waveform so how to proceed with the Frequency measurement using Verilog Hdl.

I tried some logics for measuring the frequency like Using the up counter at rising edge and count till falling edge but this doesn't work .

\$\endgroup\$
0
\$\begingroup\$

Imagine that you have two counters. One of them just counts the FPGA clock cycles, so you know how long (in seconds) it will take for that counter to overflow.

The second counter counts pulses of your sensor input. When the first counter overflows, save the value of the second counter. This value is the frequency of the sensor input. At the same time, clear the second counter and start over.

In other words, measure the frequency of the input signal directly, don't try to measure the width of one cycle and calculate the frequency.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.