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

Discussion in 'VHDL' started by BlackHelicopter, Jun 3, 2010.

  1. BlackHelicopter

    BlackHelicopter

    Joined:
    Jun 3, 2010
    Messages:
    14
    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?
     

    Attached Files:

    BlackHelicopter, Jun 3, 2010
    #1
    1. Advertising

  2. BlackHelicopter

    eliascm

    Joined:
    Jan 30, 2009
    Messages:
    42
    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
     
    eliascm, Jun 3, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rboelio
    Replies:
    1
    Views:
    360
    Andrew Thompson
    Feb 3, 2004
  2. Nathan Pinno
    Replies:
    8
    Views:
    417
    Brian
    Jun 29, 2005
  3. JackBlack
    Replies:
    1
    Views:
    312
    JackBlack
    Sep 26, 2006
  4. Ferdi Smit
    Replies:
    0
    Views:
    807
    Ferdi Smit
    Oct 10, 2005
  5. denish
    Replies:
    5
    Views:
    5,831
Loading...

Share This Page