Electronics > Beginners

Symmetric-ish pulse stretching

(1/2) > >>

HwAoRrDk:
I've been trying to figure out a way to do this, but everything I've been able to come up with hasn't been 100% suitable.

What I'm trying to do is stretch an active-low pulse to several milliseconds in length (let's say 5ms) such that whatever the length of the input low pulse, the output is always at least 5ms low, and at least 5ms high afterwards. Basically, so that the stretched pulse has symmetrically minimum low and high 'on' and 'off' periods. See attached timing diagram. If the input pulse is longer than the minimum length, then it obviously doesn't need to be stretched, but the minimum 'off' period still needs to be maintained. If multiple short input pulses occur, they should extend (i.e. re-trigger) the stretch period. If an input pulse occurs during the 'off' period, it can probably be ignored (although I'm a little uncertain on that requirement still).

I suppose the behaviour I want can be boiled down to the following:

- Input falling edge: start output active-low 'on' period.
- Subsequent falling edges during 'on' period: re-start output 'on' period.
- Output rising edge: start output 'off' period.
- Ignore all input falling edges during 'off' period.
- Sustained input low level overrides output level.

My first thought was to use a D-type flip-flop (e.g. 74xx1G80) fed with a clock signal of approx. 200 Hz (from a simple schmitt-trigger inverter oscillator, e.g. 74xx1G14) and inverted input, but that has the problem that it can miss short input pulses if they're not occurring at the right time (i.e. during rising edge of clock).

Then I thought about using a pair of re-triggerable monostable multivibrators (e.g. 74xx123) where the input triggers the first one, the first one's /Q output triggers the second one, and the first's Q and second's /Q outputs are commoned together with diodes to activate an N-ch MOSFET that drives the (open-drain) output. But that has the problem that it doesn't ignore input pulses during the 'off' period given by the second monostable - a pulse then will cause an output 'on' pulse equal in length to the input pulse's offset into the 'off' period.

Any suggestions for solutions?

Benta:
Use the CD4538/MC14538 or 74HC4538 type instead.
Set the first MMV to be retriggerable and the second to non-retriggerable. You'll likely need a bit of gating of the outputs.
That would give you:
1: negative edge in: start the "on"(L) 5 ms period. Additional negative edges will extend the "on" time accordingly after the last edge.
2: when "on" times out, the second MMV will run for 5 ms.

Is that what you're looking for?

HwAoRrDk:

--- Quote from: Benta on May 20, 2024, 08:51:01 pm ---Use the CD4538/MC14538 or 74HC4538 type instead.
Set the first MMV to be retriggerable and the second to non-retriggerable.

--- End quote ---

How do you set a '4538 to non-retriggerable? I'm looking at a datasheet and I don't see any option for that. :-//

Benta:

--- Quote from: HwAoRrDk on May 20, 2024, 09:59:46 pm ---How do you set a '4538 to non-retriggerable? I'm looking at a datasheet and I don't see any option for that. :-//

--- End quote ---
Use this data sheet:
https://www.onsemi.com/pdf/datasheet/mc74hc4538a-d.pdf  (page 12)

shapirus:

--- Quote from: Benta on May 20, 2024, 10:03:48 pm ---
--- Quote from: HwAoRrDk on May 20, 2024, 09:59:46 pm ---How do you set a '4538 to non-retriggerable? I'm looking at a datasheet and I don't see any option for that. :-//

--- End quote ---
Use this data sheet:
https://www.onsemi.com/pdf/datasheet/mc74hc4538a-d.pdf  (page 12)

--- End quote ---
But can't the 123 be made non-retriggerable the same way?

I'm reading, re-reading and comparing the datasheets of 4538 and 123 and can't see any difference between them. But it has to exist! What am I missing?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod