interval dependent one shot pulse length

Discussion in 'Analog & Mixed-Signal Design' started by patpin, Jun 10, 2018.

  1. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Arduino IDE ; and Processing 3 from Ben Frey
     
  2. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Thanks, looks interesting but cannot measure lengths, so I cannot check if it matches post # 20 requirements. Do you have the cd4000_v.lib.
     
    Last edited: Jun 11, 2018
  3. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    'Do you have the cd4000_v.lib' was already asked but I cannot delete this post23.... since it also deletes #22
     
    Last edited: Jun 11, 2018
  4. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Any idea of the calculation time Dana, taking into account requirements described in post #20.
     
  5. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    ~ 15 uS. see attached.

    Not optimized, used PSOC to gen its own test signal.
    Have not tried out end limits of Pulse over Range yet.

    See attached.

    I looked at your spec, I thought you wanted a square wave out, slightly
    lower period than incoming pulse ? In this setup its 4 clocks shorter,
    read 32 uS.

    The only time you get a square wave is when input is periodic, thereby
    triggering a square every cycle of input.

    Regards, Dana.
     
    Last edited: Jun 12, 2018
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,747
    2,019
    Yer tiz
     
    patpin likes this.
  7. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    I need a square wave after every P pulse but the length is based on the most recent interval of the P pulses - 1ms and - calculation time.
     
  8. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    Maybe finally I am getting it, something like ph1 and ph2 relationship ?

    upload_2018-6-12_15-25-41.png

    Basically dead time insertion in PWM work. So you have a varying period
    and you want a pulse train that is same period but falls inside the incoming
    interval between pulses ?

    If thats the case use a counter in PSOC to measure the period, update
    the PWM period each time you measure incoming period, other settings
    in PWM would be fixed, dead time width, etc.., and this process would
    track the incoming signal.

    Dead time insertion is a programmable, on the fly, mode in PSOC PWM,
    as well as its period, duty cycle. I am sure in other UPs same capability.

    Whats tricky here is latency because you have to use a period of incoming
    to get the measurements and calcs for the next cycle to change. So one interval
    goes by then the modified pulse output occurs. The calcs by the way done in HW.
    All that is done is freq cntr period read then written to PWM.

    Regards, Dana.
     
    Last edited: Jun 12, 2018
  9. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Hello Dana, My P-pulses are pulses, not sq.waves. After each P-pulse Pn+1 the previous interval between Pn+1 and Pn has to be evaluated and the one shot should fire as soon as the evaluation is accomplished (max 200µs after Pn+1) and the sq.wave length duration should be [previous Pn to Pn+1 interval] - 1ms - [evaluation time] ; and the 1ms should be adjustable in hard- or software. examples in post#20: where the interval is 5ms, the one shot fired afterward is (5-1ms - calculation time c) long.
     
  10. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    sorry I have to ask for the sym file..
     
  11. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    Something like this, ph2 ?

    upload_2018-6-12_16-49-24.png
     
  12. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Thanks Dana. Since my P waves are pulses the time should be measured from rising edge of the pulse and the one shot HIGH should end about 1 sec before the start of the rising edge of the next P pulse (this in the supposition that the interval hasn't changed.). Which of yr params defines this -1ms?
     
  13. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    Thats dead time in clocks parameter in PWM settings, programmable.

    But again the UP cannot predict when the next pulse comes (unless pulse train periodic) except to measure
    one cycle, pulse to pulse, then act on the next cycle.

    As stated earlier a number of ways to implement this in PSOC, I was just looking
    at min HW needed to do the job with the more recent posts.

    Regards, Dana.
     
  14. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    hello, can one simulate a row of pulses as in my post #20 in the PSOC IDE?
    How much time is needed for the interval evaluation?
     
  15. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    The interval, period, is just a counter with a gate. So answer is a simple read at end of gate,
    a couple of uS. Earlier I found in screen shot that from end of second pulse to generating
    the reduced period square to be ~ 15 uS, and I think with some more work could possibly
    make that even smaller. Like Verilog solution.

    Yes my test part of design can generate a fixed number or continuous stream of pulses.
    Thats frankly quite easy. Or the whole design generating squares.

    Regards, Dana.
     
    patpin likes this.
  16. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Thanks for all info Dana; this is an entirely new domain for me.
     
  17. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,747
    2,019
    Here's a zip of the CD4000 (and CD4000_v) asy files:
     
    patpin likes this.
  18. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    Here is blown up example -

    upload_2018-6-13_9-51-19.png

    This will track incoming period so that generated pulse ends ~ 1 mS before
    next incoming pulse starts as you stated

    Regards, Dana.
     
  19. danadak

    Well-Known Member

    Mar 10, 2018
    1,738
    354
    An example at slower pulse rate in -

    upload_2018-6-13_11-27-45.png

    Regards, Dana.
     
  20. patpin

    Thread Starter Active Member

    Sep 15, 2012
    362
    18
    Very nice Dana. Reaction time is very fast Can one analyse analog phenomena with PSOC? You have long experience with it. Is it sufficiently robust to function in automotive environment where air temperatures can go up to 100°C? Regards
     
Loading...