+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Advanced Member level 1
    Points: 4,332, Level: 15

    Join Date
    Jul 2006
    Location
    USA
    Posts
    406
    Helped
    7 / 7
    Points
    4,332
    Level
    15

    how to synchronize the signal and the external clock

    "in" is the signal, the start and end point is unknown.
    clk is the clock signal from outside of the chip, and its phase can't be changed.
    I need to use one high-frequency and one low-frequency clock to count the signal "in".
    Click image for larger version. 

Name:	1.png 
Views:	13 
Size:	112.7 KB 
ID:	138751

    in case 1, t2 is the time counted by the low-frequency clock. t1 and t3 are counted by high-frequency signal clock.
    in=t1+t2-t3.


    If I can synchronize the "in" signal and the low-frequency clock, as in case 2, t4 is the time counted by the low-frequency clock. t5 is counted by high-frequency signal, then the time of "in" is:
    in=t4-t5.

    It is conventient for me in case 2, since there is only one time interval counted by the high frequency clock.
    How can I delay the "in" signal to synchronize the clk rise edge?

    I want to achive it without complex logic, do not use pll. Is there a way to deal with it? Thanks.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 19,190, Level: 33
    Achievements:
    7 years registered
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,690
    Helped
    878 / 878
    Points
    19,190
    Level
    33

    Re: how to synchronize the signal and the external clock

    Not quite clear what you want, but perhaps a D-Flipflop with the D connected to the "in" signal and its CLK provided by the high frequency clock would do what you need.
    Zapper
    Curmudgeon Elektroniker


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 24,487, Level: 38
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,703
    Helped
    1038 / 1038
    Points
    24,487
    Level
    38

    Re: how to synchronize the signal and the external clock

    Basically, you need to synchronize both the rising and falling edges. The way I would approach this, and I'm sure there are others, is to use a single high-speed clock whose frequency is determined by your accuracy requirements, and sample the input with that. Maybe you need a synchronizer, maybe not (if you don't care about metastability). As proposed by my esteemed colleague Crutschow, use a dff; use the Q output to enable a counter which is clocked by the high speed clock. There's no need to fart around with two different clocks.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 1
    Points: 4,332, Level: 15

    Join Date
    Jul 2006
    Location
    USA
    Posts
    406
    Helped
    7 / 7
    Points
    4,332
    Level
    15

    Re: how to synchronize the signal and the external clock

    Thanks.

    Clk is the low-frequency clock, and another high-frequency signal is used to count the residue signal (T1 and T3 in case1).

    The reason to use two frequency signals is to reduce the power. If a long time "in" signal counted only by a high-frequency clock, then it will consume too much power.



  5. #5
    Advanced Member level 5
    Points: 24,487, Level: 38
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,703
    Helped
    1038 / 1038
    Points
    24,487
    Level
    38

    Re: how to synchronize the signal and the external clock

    Quote Originally Posted by shanmei View Post
    Thanks.

    Clk is the low-frequency clock, and another high-frequency signal is used to count the residue signal (T1 and T3 in case1).

    The reason to use two frequency signals is to reduce the power. If a long time "in" signal counted only by a high-frequency clock, then it will consume too much power.
    Too much power? How much is "too much"? How much power will the additional complexity of the two-clock circuitry consume? What kind of application is this?


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  6. #6
    Advanced Member level 5
    Points: 15,100, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,508
    Helped
    810 / 810
    Points
    15,100
    Level
    29

    Re: how to synchronize the signal and the external clock

    First of all, define: "long time". Is it an hour, a day, a year?

    Then define the "residue", is it a second, a millisecond, a nanosecond?

    Without specific parameter values we are only wildly speculating.


    1 members found this post helpful.

  7. #7
    Advanced Member level 1
    Points: 4,332, Level: 15

    Join Date
    Jul 2006
    Location
    USA
    Posts
    406
    Helped
    7 / 7
    Points
    4,332
    Level
    15

    Re: how to synchronize the signal and the external clock

    The maxim total time is around 100uS with the coarse clock of 1MHz, and the fine clock frequency is 1GHz.



--[[ ]]--