开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io

How to create a pos/neg edge trigger??


 

开云体育

What MCU are you using?
?
----------------------

Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?


sd7008us
 

Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at least
200ms wide.

Regards,

SD


Stefan Trethan
 

you want a monostable flipflop which can be triggered both edges.

possible transistors, opamp, or ic.

ST

On Thu, 08 Apr 2004 05:04:25 -0000, sd7008us <sd7008us@...> wrote:

Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at least
200ms wide.

Regards,

SD


Yahoo! Groups Links

To visit your group on the web, go to:


To unsubscribe from this group, send an email to:
Electronics_101-unsubscribe@...

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


Stefan Trethan
 

just remembered making this once by inverting "foo" so you only
need one trigger direction... i used ot for geting a pulse
from each zero crossing of a 50Hz sine.
look for the common monostable multivibrator circuits and make
the trigger R/C twice. then invert foo and feed it to the triggers inv and non inv.

good luck

On Thu, 08 Apr 2004 09:07:15 +0200, Stefan Trethan <stefan_trethan@...> wrote:

you want a monostable flipflop which can be triggered both edges.

possible transistors, opamp, or ic.

ST


On Thu, 08 Apr 2004 05:04:25 -0000, sd7008us <sd7008us@...> wrote:

Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at least
200ms wide.

Regards,

SD


Yahoo! Groups Links

To visit your group on the web, go to:


To unsubscribe from this group, send an email to:
Electronics_101-unsubscribe@...

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





Yahoo! Groups Links





Keith
 

--- In Electronics_101@..., "sd7008us" <sd7008us@y...> wrote:
Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at least
200ms wide.

Regards,

SD
SD

An exclusive OR gate with the input signal to one side delayed. Do
you really want a 200ms interrupt pulse? That is one seriously slow
processor.

Keith.


Keith
 

--- In Electronics_101@..., "sd7008us" <sd7008us@y...> wrote:
Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at least
200ms wide.

Regards,

SD
SD,

An exclusive OR gate would do this by delaying the signal to one input
with a resistor and capacitor (and schmitt trigger if the delay is
long). However, can you not switch the interrupt trigger edge over
each time you detect an edge? Also, a 200ms interrupt seems very long.

Keith.


Stefan Trethan
 


An exclusive OR gate would do this by delaying the signal to one input
with a resistor and capacitor (and schmitt trigger if the delay is
long). However, can you not switch the interrupt trigger edge over
each time you detect an edge? Also, a 200ms interrupt seems very long.

Keith.

yes that is a way better idea than the monoflop...

ST


sd7008us
 

Thanks all for the responds. How about we doing the following way?
Would it consider a workaround (not a clean way)?

The foo signal is coming from a push button and we need to interrupt
the MCU every time it changes value. There are two interrupts pins
to the MCU. We also need to debounce the signal after the first
interrupt that is why we need 200ms on the pulse. Here is what we
think will work: we feed the "foo" signal directly to the first
interrupt (Int0) and trigger it on the Negative edge. Then, we
inverted the "foo" and feed the output to the second interrupt
(Int1). The fireware will have to do the extra worrk to track the
states of "foo".

Here is how the waveform would look:

====================================================================

foo: -----------________----------_________-----------
Int0 Int0

/foo: ________----------________------------________
Int1 Int1
=====================================================================

This method only need one interal "PLD" inverter and no external
parts needed.

Any thoughts on this?

Regards,

SD



--- In Electronics_101@..., Stefan Trethan
<stefan_trethan@g...> wrote:


An exclusive OR gate would do this by delaying the signal to one
input
with a resistor and capacitor (and schmitt trigger if the delay
is
long). However, can you not switch the interrupt trigger edge
over
each time you detect an edge? Also, a 200ms interrupt seems very
long.

Keith.

yes that is a way better idea than the monoflop...

ST


sd7008us
 

Hi All,

It turns out, I only need 600ns delay on the interrupt pulse. What
is the best method to delay the second input signal to the XOR gate?
There is PLD gates avilable in the MCU. Would a series of "AND" does
the job?

Regards,

SD

--- In Electronics_101@..., "Keith" <keith@k...> wrote:
--- In Electronics_101@..., "sd7008us" <sd7008us@y...>
wrote:
Hi All,

I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?

Here is the waveform:

foo: --------______--------___________--------

interrupt: -------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has to be at
least
200ms wide.

Regards,

SD
SD

An exclusive OR gate with the input signal to one side delayed. Do
you really want a 200ms interrupt pulse? That is one seriously
slow
processor.

Keith.


sd7008us
 

I tried to respond to the post, but has not apeared on the messages
board yet.

Anyway, it turns out I only need 600ns interrupts pluse. Any idea
what is the best way to delay the second input of the XOR gate? The
MCU we are using has PLD gates that we can program. Would a series
of ANDs do the job?

Any ideas??

Regards,

SD


 

开云体育

In a message dated 4/8/2004 12:05:16 AM Central Standard Time, sd7008us@... writes:
I need to generate an interrupt pulse on every edge (rising or
falling) of an input signal to a MCU. Any idea how to do this?
The most versatile monostable (dual!) is the 74HC4538!


 

You might look at the 4528 CMOS multivibrator - it can
be triggered on either a positive or negative edge.
Alternatively, you could make two half monostables and
OR them together. Don Lancaster, in hid book "CMOS
Cookbook" has a pretty good explanation of half
monostables. (4528 would be easier.)

Jim
--- sd7008us <sd7008us@...> wrote:
Hi All,

I need to generate an interrupt pulse on every edge
(rising or
falling) of an input signal to a MCU. Any idea how
to do this?

Here is the waveform:

foo:
--------______--------___________--------

interrupt:
-------__-----__------__---------__------


I do have the clock avilable. The interrup pulse has
to be at least
200ms wide.

Regards,

SD

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway


 

At the risk of being branded a microcontroller bigot (I'm not,
really!), why not do this solely in the mcu? Debounce is pretty easy
(most bouncing occurs for about 1-2 mS, according to Horowitz/Hill)
in software. Of course if your MCU is busy doing other things, you
may not be able to watch the switch.

Your dual interrupt idea works though you would need an external
inverter. Can you trigger on leading or training edges? You might
be able to get away with bringing the switch into a port and watching
the transitions on it. If the responsiveness needs only to be in the
100s of mS range, you could poll the pin every 50-100 uS and use a
little state machine to determine switch state (i.e. debounced).

External debounce can also be done with a resistor and a cap. H/H
has a discussion of this. Sorry, I'm too lazy to look up the page.

As usual, there are at least 100 ways to skin this cat.

Phil


Keith
 

--- In Electronics_101@..., "sd7008us" <sd7008us@y...> wrote:
Hi All,

It turns out, I only need 600ns delay on the interrupt pulse. What
is the best method to delay the second input signal to the XOR gate?
There is PLD gates avilable in the MCU. Would a series of "AND" does
the job?
You only need a delay that is long enough to produce the interrupt
pulse width required to trigger the microprocessor. If that is say
250ns, you need to delay by at least that. A resistor to one input of
the XOR gate and a capacitor to ground on that input would do it. A
few AND gates will probably be a bit too quick and produce a rather
short interrupt pulse.

Can you select in software which edge the interrupt triggers on?
Could you debounce the switch in software?

Keith.


 

开云体育

As somebody else posted you could use a 74hc4538. This is a dual one shot. You can configure it to trigger on both positive and negative edges. Forgot about that IC, that is likely the easiest idea yet.
========

I tried to respond to the post, but has not apeared on the messages
board yet.

Anyway, it turns out I only need 600ns interrupts pluse. Any idea
what is the best way to delay the second input of the XOR gate? The
MCU we are using has PLD gates that we can program. Would a series
of ANDs do the job?

Any ideas??


 

开云体育

In a message dated 4/9/2004 3:48:51 AM Central Standard Time, sd7008us@... writes:
Would a series of ANDs do the job?
A 100 pF cap in series with the second gate, and a reasonable resistor from that gate-input to, what, ground, should work!? 10K?? Experiment!? Got a dual-trace 'scope?


 

开云体育

I think you meant the opposite, right......cap to ground and resistor in series.
?
The config you desribe will not give any delay, rather it will shorten the length of the input to the second gate.
?
Do you concur?
======================

A 100 pF cap in series with the second gate, and a reasonable resistor from that gate-input to, what, ground, should work!? 10K?? Experiment!? Got a dual-trace 'scope?


 

开云体育

In a message dated 4/9/2004 6:43:06 PM Central Standard Time, smartdim@... writes:
I think you meant the opposite, right......cap to ground and resistor in series.
Duh...?? Yes.? Alzheimer's has struck again!? But it requires TWO resistors!


 

开云体育

In a message dated 4/11/2004 4:36:00 PM Central Standard Time, JanRwl@... writes:
But it requires TWO resistors!
(Sorry!? ONLY if the input was a "sink-only" gate-output.? For a souce/sink gate-output, only the ONE series resistor would be needed.? I'd have to do some trial-and-error with a 'scope on the breadboard, but probably something like a 1K or so R and maybe smaller than a 0.001 cap?? No guess without trying it for a few minutes.)