# Creating a delayed pulse, given a pulse train

#### drkblog

Joined Oct 4, 2012
109
This may sound a little obvious, but even when I think of ways for doing this, I think there must be something simpler:

I have a digital signal (a train pulse) lets say 200ms active 50ms passive. And I need to create another pulse of 5ms matching the last 5 ms of the passive period:

Rich (BB code):
Original

200        50
--------+      +---
|      |
+------+

Created
5
+-+
| |
-------------+ +---
What would be the simplest / cheaper way of doing this?

#### praondevou

Joined Jul 9, 2011
2,942
Any clock available? What precision do you need?

If no clock is available and you don't need high precision you can use the falling edge of the 200ms to trigger a 555 monostable whose falling edge triggers a second 555 monostable (after 45ms).

It depends on the delays necessary between the 200ms and 5ms edges etc to determine if this would be suitable. What is it used for? Where does the pulse train come from?

#### drkblog

Joined Oct 4, 2012
109
Any clock available? What precision do you need?
It depends on the delays necessary between the 200ms and 5ms edges etc to determine if this would be suitable. What is it used for? Where does the pulse train come from?
No clock. The original train is from a 555 astable circuit. In fact it's a 556 so I could use the second timer for that.

I need this for synchronizing a counter and a 7 segment display. During the low period (50ms) I have to count. Then I have to show the number in the display. I have /Latch and Reset controls. I could use the original signal for both controls. So the circuit would latch and reset during high, and show the counter and count during low. At some point that works, specially because the count time is short and the human eye is slow. But as the count time increases, the display will start going unstable, or difficult to read.

I though the second (delayed) pulse would be useful for disable latching just over the end of the count time.

#### MrChips

Joined Oct 2, 2009
28,471
I think you have the carriage before the horse.
What you are trying to implement is a classic counter/display sequence which goes:

reset - count - latch - reset ...

Just design three timing signals to follow each other in sequence A-B-C and everything should fall into place.

Note that the reset and latch pulses can be as short as 50ns and therefore might have negligible effect on your count accuracy.

#### drkblog

Joined Oct 4, 2012
109
Well, that's the point. I have a sequence of two stages (original) and I want to build the three stages you mentioned. The question is what's the cheapest way. I have an astable timer and I can use a monostable as praondevou suggested. Which is what I'm going to do. Is there another way?

#### THE_RB

Joined Feb 11, 2008
5,438
No clock. The original train is from a 555 astable circuit. In fact it's a 556 so I could use the second timer for that.

I need this for synchronizing a counter and a 7 segment display. During the low period (50ms) I have to count. Then I have to show the number in the display.
...
This sounds like a typical repeating "random" number generator. The typical way is to run the oscillator and counter when the 555 output is HI, then when the 555 output goes LO it latches the count to the display.

You need a 555 oscillator and the counter IC, then another 555 to do the "gating" task. You set up the display driver to latch on the 555 output \ edge.

#### MrChips

Joined Oct 2, 2009
28,471
What you need is an edge triggered monostable. And the simplest way to implement a monostable is with a capacitor and a resistor.

#### drkblog

Joined Oct 4, 2012
109
Well, I designed the circuit using the second timer of the LM556 as a monostable triggered in the negative edge of the main timer. That gives me the first two signals of this graphic. But I needed the third signal, which is a NOR of the other two:
Rich (BB code):
Main timer

200ms       50ms
----------+        +-------
|        |
+--------+

Monostable
45ms
+-----+
|     |
----------+     +----------

Latch disable

5ms
+--+
|  |
----------------+  +-------
So I built a NOR gate using two transistors and a couple of resistors. Is it a good idea to build gates using transistors (when you need only one gate)?

#### MrChips

Joined Oct 2, 2009
28,471
So I built a NOR gate using two transistors and a couple of resistors. Is it a good idea to build gates using transistors (when you need only one gate)?
I see nothing wrong with that. You should be able to do it with one transistor and some resistors.

#### drkblog

Joined Oct 4, 2012
109
This is the signal I've got by conecting the Main timer and the monostable to the NOR gate built with the circuit on the right. In the oscilloscope you can see the NOR output in red and the main timer in green:

I'm worried about the 2.3V level in the output when A is 5V and B is 0V...

Last edited:

#### drkblog

Joined Oct 4, 2012
109
Problem solved simplifying the NOR circuit:

#### timescope

Joined Dec 14, 2011
298
I would :
1. Generate 4 times the frequency with a 555 square wave circuit ( R1<< R2 or with a
diode across R2).
2. Use a 4013 to divide by 4.
3. Use gates like 4011,4001 etc to gate the 5 outputs to obtain the sequence.
Timescope.

#### drkblog

Joined Oct 4, 2012
109
In the end, I solved it using both timer of the LM556 and no gates at all. I created a timer at 2Hz (astable) and triggered the second timer (monostable for 50ms) upon negative edge of the first timer. Used the first one as the reset and the second one as the latch disable. And this worked.

Of course latch is disabled during count time, but since it's only 50ms it isn't a problem. The solution I was trying to implement didn't worked because the counter reset takes place before latch is enabled. The right solutions would be using the enable signal of the counter too. But that circuit was being recycled and I didn't want to modify it.

Last edited:

#### drkblog

Joined Oct 4, 2012
109
Nice! I used a similar circuit in a previous circuit (from the project I inherited the counter/latch/7-seg module). As you say, playing with capacitor values you can get the delay. In this case, as I was around 50ms I knew it wasn't going to be visible. And reduced the cost and the size of the circuit. Good enough for a prototype, I guess.

#### takao21203

Joined Apr 28, 2012
3,702
A 16F54 could be used for this application.
These simple controllers are meant to be to replace circuits based on several ICs, and additional discrete components.