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\$

1 Answer 1

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.