# Additional features on FPGA

**URL:** <https://discourse.myriadrf.org/t/additional-features-on-fpga/4997>\
**Category:** LimeSDR\
**Created:** [1 August 2019 06:23 UTC](https://discourse.myriadrf.org/t/additional-features-on-fpga/4997 "2019-08-01T06:23:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![VytautasB](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@VytautasB](https://discourse.myriadrf.org/u/VytautasB)\
**Post date:** [1 August 2019 14:56 UTC](https://discourse.myriadrf.org/t/additional-features-on-fpga/4997/2 "2019-08-01T14:56:22Z")

</div>

Hello, [Martin\_T](https://discourse.myriadrf.org/u/Martin_T)

Not sure if I correctly understand what are you trying to achieve but if you modify your code as:

```
process(clk, reset_n)
begin
	if reset_n = '0' then 
        mux_sel = '0'
	elsif (clk'event AND clk='1') then 
		if (((abs_val >= threshold OR abs_val_a >= threshold OR abs_val_b >= threshold) AND trigger_en = '1') OR trigger_en = '0') then
            mux_sel = '1';
        else
            mux_sel = mux_sel;
		end if;
	end if;
end process;

process(clk, reset_n)
begin
	if reset_n = '0' then 
		out_wrreq <= '0';
		out_cnt_en <= '0';
	elsif (clk'event AND clk='1') then 
		if mux_sel = '1' then
			out_wrreq <= wrreq;
			out_cnt_en <= in_cnt_en;
		else
            out_wrreq <= '0';
            out_cnt_en <= '0';
		end if;
	end if;
end process;

```

this will start capturing samples after “abs\_val” reaches “threshold” and stop only when reset\_n goes to ‘0’.

---

_[View the full topic](https://discourse.myriadrf.org/t/additional-features-on-fpga/4997)._
