Hi I'm new to the fpga world, just got a Xilinx Spartan 3E and started playing around with it in verilog with ISE design tools.
My frustration came when I try to use 2 external triggers to activate counters. My goal is to make a program that when given 3 posedges of a push button in a range of 5 seconds turns on a led. If the 5 seconds go and there haven't been 3 events from the push, resets and restart the process.
I tried to code this and the concept was something like this
Always@(posedge push)
**if first push then flag=1**
Always @(posedge clock)
** if flag==1 then start counter
**check function for pushes and time reset
This had the issue that I had to change registers on both blocks so I've been told to put both processes in one block. The problem with it is that I don't see a way to make the push posedge work since the clock is always faster.
Is there a way for me to activate a clock counter after another posedge event and make it synthesizable. I know for a fact this is a possible implementation using a counter that controls another one via reset or enable and I would just make it through schematic if it wasn't for the absurdly large counter that is needed with a 50Mhz clock.
Please help me with this and I'll be eternally grateful.