+ Post New Thread
Results 1 to 19 of 19
  1. #1
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    stretching the 0 pulse of a digital output with a certain T

    Hello, i have a digital output with varying pulse sizes and i want to stretch the 0 output for a constant T+ 0 pulse time. I have tried using a monostable multivibrator with a NAND gate but the problem i got is that the length of the pulse remains constant, which could be a problem if the pulse width is greater than the multivibrator output so how to add this time constant to the original pulse width instead?

    - - - Updated - - -

    Click image for larger version. 

Name:	reset_stretching.PNG 
Views:	45 
Size:	1.2 KB 
ID:	153710
    here's an image of the desired output

  2. #2
    Super Moderator
    Points: 75,476, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,301
    Helped
    3485 / 3485
    Points
    75,476
    Level
    67

    Re: stretching the 0 pulse of a digital output with a certain T

    Hi,

    Specify the timing. Is it picoseconds or hours?

    What supply voltage and what logic family?

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  3. #3
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by KlausST View Post
    Hi,

    Specify the timing. Is it picoseconds or hours?

    What supply voltage and what logic family?

    Klaus
    Timing is about 50-100ms. Supply voltage 3.3V and it's an integrated circuit



  4. #4
    Advanced Member level 3
    Points: 9,195, Level: 22

    Join Date
    Nov 2001
    Location
    US
    Posts
    786
    Helped
    219 / 219
    Points
    9,195
    Level
    22

    Re: stretching the 0 pulse of a digital output with a certain T

    100ms is a lot for an IC. If you have a clock, use a counter for the timing.



    •   AltAdvertisement

        
       

  5. #5
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    the RC could be added outside or i can just reduce the time



  6. #6
    Advanced Member level 4
    Points: 7,655, Level: 20

    Join Date
    Jan 2015
    Posts
    1,077
    Helped
    340 / 340
    Points
    7,655
    Level
    20

    Re: stretching the 0 pulse of a digital output with a certain T

    The problem with the circuit you propose (monostable and NAND gate) is the NAND gate. You want a '0' output if EITHER the monostable is low (in the case of the pulse being shorter than the monostable period) OR the pulse is low (in the case of the pulse being longer than the monostable period).
    Therefore the output should be '1' only when BOTH the input line and the monostable are high - so you want an AND gate.
    (This assumes that the \Q\ output of the monostable is being used - that's the one that is normally high and low when the monostable is triggered.)
    Drawing out the timing diagram of the situation when the pulse is longer than the monostable period and putting that with the one you drew in the first post would show you the solution.
    Susan



  7. #7
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by Aussie Susan View Post
    The problem with the circuit you propose (monostable and NAND gate) is the NAND gate. You want a '0' output if EITHER the monostable is low (in the case of the pulse being shorter than the monostable period) OR the pulse is low (in the case of the pulse being longer than the monostable period).
    Therefore the output should be '1' only when BOTH the input line and the monostable are high - so you want an AND gate.
    (This assumes that the \Q\ output of the monostable is being used - that's the one that is normally high and low when the monostable is triggered.)
    Drawing out the timing diagram of the situation when the pulse is longer than the monostable period and putting that with the one you drew in the first post would show you the solution.
    Susan
    ok is there any possible way to stretch it for around 100ns digitally without using the RC?



  8. #8
    Super Moderator
    Points: 75,476, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,301
    Helped
    3485 / 3485
    Points
    75,476
    Level
    67

    Re: stretching the 0 pulse of a digital output with a certain T

    Hi,

    ok is there any possible way to stretch it for around 100ns digitally without using the RC?
    Did you read post#4?
    You did not react on this suggestion...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  9. #9
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by sutapanaki View Post
    100ms is a lot for an IC. If you have a clock, use a counter for the timing.
    implementing a counter would be complicated especially that i need to delay it for only 2 clock cycles and i guess the counter would stretch both pulses?



    •   AltAdvertisement

        
       

  10. #10
    Super Moderator
    Points: 257,269, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,887
    Helped
    13656 / 13656
    Points
    257,269
    Level
    100

    Re: stretching the 0 pulse of a digital output with a certain T

    I'm not sure what we are currently talking about because the original 100 ms delay shrunk to 100 ns in the meantime. There's a certain state of the art for reset generators, usual delays are in a several 10 to several 100 ms range. They are implemented as digital timers with e.g. high kHz oscillator to save chip area. Purely analog implementations with pF capacitor and pA current source would be possible nevertheless, probably less accurate.

    implementing a counter would be complicated especially that i need to delay it for only 2 clock cycles and i guess the counter would stretch both pulses?
    Why particularly?

    - - - Updated - - -

    An analog reset timer with external timing capacitor http://www.ti.com/lit/gpn/tps3895



  11. #11
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by FvM View Post
    I'm not sure what we are currently talking about because the original 100 ms delay shrunk to 100 ns in the meantime. There's a certain state of the art for reset generators, usual delays are in a several 10 to several 100 ms range. They are implemented as digital timers with e.g. high kHz oscillator to save chip area. Purely analog implementations with pF capacitor and pA current source would be possible nevertheless, probably less accurate.

    Why particularly?

    - - - Updated - - -

    An analog reset timer with external timing capacitor http://www.ti.com/lit/gpn/tps3895
    i have a 50MHz clock provided so i was thinking about delaying it digitally without using any capacitors as another solution for at least 2 cycles (40ns) by using a Dflipflop as a frequency divider but this will affect both pulses, which is not desired. The provided gates in the technology are the primitive gates so if i want to implement more complicated gates i have to design it on analog level. Additionally the circuit should be low power



  12. #12
    Advanced Member level 3
    Points: 9,195, Level: 22

    Join Date
    Nov 2001
    Location
    US
    Posts
    786
    Helped
    219 / 219
    Points
    9,195
    Level
    22

    Re: stretching the 0 pulse of a digital output with a certain T

    Conceptually, how about you trigger the counter with the rising edge of your short pulse and let it count for as long as you need. When it is done counting, it generates a transition, say low to high, kind of ready signal. Then use a sort of a RS latch which is asserted low with the falling edge of your short pulse and deasserted to high with the counter ready signal.


    1 members found this post helpful.

  13. #13
    Super Moderator
    Points: 75,476, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,301
    Helped
    3485 / 3485
    Points
    75,476
    Level
    67

    Re: stretching the 0 pulse of a digital output with a certain T

    Hi,

    In post#3 you talk about 50...100ms.
    Now you talk about 40ns.
    Why?
    This is more than a million factor away...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  14. #14
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by KlausST View Post
    Hi,

    In post#3 you talk about 50...100ms.
    Now you talk about 40ns.
    Why?
    This is more than a million factor away...

    Klaus
    I'm trying to do both variants, so i thought delaying it digitally would be easier.

    Quote Originally Posted by sutapanaki View Post
    Conceptually, how about you trigger the counter with the rising edge of your short pulse and let it count for as long as you need. When it is done counting, it generates a transition, say low to high, kind of ready signal. Then use a sort of a RS latch which is asserted low with the falling edge of your short pulse and deasserted to high with the counter ready signal.
    I tried generating a set signal from the rising edge of the pulse i got and feeding it as a set signal for the "counter" which is a d-flipflop with its D connected to the Qn. The problem right now is that the counter will keep counting so i will have half the clock frequency on the output after the pulse goes high as in the simulation. does anyone has a hint how to make it stop after this clock cycle?Click image for larger version. 

Name:	counter_01.PNG 
Views:	5 
Size:	21.4 KB 
ID:	153879Click image for larger version. 

Name:	counter_02.PNG 
Views:	4 
Size:	104.7 KB 
ID:	153880



  15. #15
    Advanced Member level 3
    Points: 9,195, Level: 22

    Join Date
    Nov 2001
    Location
    US
    Posts
    786
    Helped
    219 / 219
    Points
    9,195
    Level
    22

    Re: stretching the 0 pulse of a digital output with a certain T

    A counter by itself is a state machine. A counter the way you have done it will keep on counting for as long as there is clock. Surely you can design a counter that is triggered by your short pulse as you did but then when it reaches the count you need, it stops and waits for the trigger to start counting again.



  16. #16
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Yea that was my question if i can achieve that with some flipflops as it's an ic design so i can't use a ready ic



    •   AltAdvertisement

        
       

  17. #17
    Advanced Member level 3
    Points: 9,195, Level: 22

    Join Date
    Nov 2001
    Location
    US
    Posts
    786
    Helped
    219 / 219
    Points
    9,195
    Level
    22

    Re: stretching the 0 pulse of a digital output with a certain T

    Yes, of course you can achieve it. Make the flow diagram of the thing and based on it design the circuit.
    Here is a dirtier way of perhaps doing it. I did not simulate the circuit, so there is some possibility of error, but I hope you'll get the idea. I have assumed your short pulse is in sync with the clock as you show in your diagrams.

    Click image for larger version. 

Name:	pulse.PNG 
Views:	5 
Size:	144.2 KB 
ID:	153900



  18. #18
    Advanced Member level 4
    Points: 6,072, Level: 18
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    1,166
    Helped
    179 / 179
    Points
    6,072
    Level
    18

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by iaf View Post
    Hello, i have a digital output with varying pulse sizes and i want to stretch the 0 output for a constant T+ 0 pulse time. I have tried using a monostable multivibrator with a NAND gate but the problem i got is that the length of the pulse remains constant, which could be a problem if the pulse width is greater than the multivibrator output so how to add this time constant to the original pulse width instead?

    - - - Updated - - -

    Click image for larger version. 

Name:	reset_stretching.PNG 
Views:	45 
Size:	1.2 KB 
ID:	153710
    here's an image of the desired output
    Trigger from the negative edge, and hold till positive edge. Retrigger again at positive edge.
    Thats the logic. Just have to implement it.

    - - - Updated - - -

    Childish problem. Whats the big concern ?



  19. #19
    Member level 3
    Points: 281, Level: 3

    Join Date
    Apr 2019
    Posts
    55
    Helped
    0 / 0
    Points
    281
    Level
    3

    Re: stretching the 0 pulse of a digital output with a certain T

    Quote Originally Posted by sutapanaki View Post
    Yes, of course you can achieve it. Make the flow diagram of the thing and based on it design the circuit.
    Here is a dirtier way of perhaps doing it. I did not simulate the circuit, so there is some possibility of error, but I hope you'll get the idea. I have assumed your short pulse is in sync with the clock as you show in your diagrams.

    Click image for larger version. 

Name:	pulse.PNG 
Views:	5 
Size:	144.2 KB 
ID:	153900
    well thanks for your answer i could achieve it with only 2 flipflops with the reset pulse connected to the reset pin and it just does the required. Thanks for your effort though
    Quote Originally Posted by kripacharya View Post
    Trigger from the negative edge, and hold till positive edge. Retrigger again at positive edge.
    Thats the logic. Just have to implement it.

    - - - Updated - - -

    Childish problem. Whats the big concern ?
    yea actually the problem was stopping in the "retriggering" after 2 clocks



--[[ ]]--