Need help figuring out how to control this.. edge triggering.

Joined
Jun 3, 2010
Messages
14
Reaction score
0
Hi, I'm trying to generate this signal in VHDL(signal out). I have a signal coming in (signal in) that I want to trigger off of on the rising edge, then start a counter with a 20MHz clock (I want some sort of delay that I can control) and then bring it low after the counter/delay is finished.

It's hard for me to figure this out because there are two rising edges I need to trigger off of (clk and signal in, which aren't synced up) and VHDL doesn't agree with anything I've tried. How would you implement this? Its not just the rising edges though, I'm not sure how to control the falling edge then either.

I'm having a lot of trouble coding and understanding VHDL and get stuck on problems like this often, anyone have any good advise?
 

Attachments

  • Time Delay Trigger Signal.JPG
    Time Delay Trigger Signal.JPG
    10.7 KB · Views: 208
Joined
Jan 30, 2009
Messages
42
Reaction score
0
Clocked Delay Started by Input Signal

Since the input signal is not synchronized with the counter clock you will need to use a "synchronizer" on that signal. A common synchronizer is 2 D flip-flops clocked by, in this case, the counter clock. The D input of the first flilp-flop is connected to the input signal and its Q output is connected to the D input of the second flip-flop. Let's call the output of the second D flip-flop sig_synch. sig_synch will be used to start (enable) the counter. If the counter is a down counter, it can be loaded with a number representing the number of clock periods of delay that you need. You can use a signal delay_done to indicate when the counter has reached the count of zero. delay_done stops the counter. You will then reload the counter and wait for the next sig_synch. I have left out a few details. For example, you want to ensure that sig_synch has gone low before the counter is enabled again or you will start a new delay cycle too soon soon.

I hope this helps. It should get you started anyway. If you get stuck again, come back and I am sure someone here will help you.

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top