Forum Discussion
Altera_Forum
Honored Contributor
12 years agoI am not familiar with your board. you will need to know when a pulse is sent to radar either by fpga triggering it or being informed.
On the ADC side, you receive digital signal and then you can check the values on each clock edge if it passed a given threshold. That threshold is matter of design details that you need to study and work out or experiment with your system. Here is a chunk of code that may help --pseudocode
if reset = '1' then
counter_en <= '0';
counter <=0;
elsif rising_edge(clk) then
if trigger = '1' then
counter_en <= '1';
end if;
if adc_value > threshold then
counter_en <= '0';
end if;
if counter_en = '1' then
counter <= counter + 1;
end if;
end if;