xilinx1001
Member level 3
- Joined
- Apr 3, 2013
- Messages
- 60
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,781
Hi
I need to trigger a sensor for 12usec and giving a delay of 50msec and the process should be continuous with the clock
I wrote something like this which is running for only one trigger and become 0 forever
if(clk'event and clk = '1') then
if(clkdiv <= "000000000001001011000" ) then
trg <= '1';
clkdiv <=clkdiv+"0000000000000000000001" ;
else
if(clkdiv > "000000000001001011000" and clkdiv < "1001100010010110100000" ) then
trg <= '0';
if (clkdiv >"1001100010010110100000") then
clkdiv<="0000000000000000000000";
end if;
end if;
end if;
Please give comments on this code
I need to trigger a sensor for 12usec and giving a delay of 50msec and the process should be continuous with the clock
I wrote something like this which is running for only one trigger and become 0 forever
if(clk'event and clk = '1') then
if(clkdiv <= "000000000001001011000" ) then
trg <= '1';
clkdiv <=clkdiv+"0000000000000000000001" ;
else
if(clkdiv > "000000000001001011000" and clkdiv < "1001100010010110100000" ) then
trg <= '0';
if (clkdiv >"1001100010010110100000") then
clkdiv<="0000000000000000000000";
end if;
end if;
end if;
Please give comments on this code