2
\$\begingroup\$

I have a window comparator with two outputs (hi-threshold and low-threshold) that would go high sequentially (few examples shown in the attached image). I want to use to combine these two signals into one, which would be used to wake up a MCU. Here's a basic truth table:

  • Red High then Blue High ---> Output High
  • Blue High then Red High ---> Output Low
  • Red Low But Blue High ---> Output Low
  • Red High But Blue Low ---> Output Low
  • Red Low And Blue Low ---> Output Low

The time difference between the trailing edge of the Red line and the leading edge of the Blue line is usually <200ms - I am still working on spec'ing it.

I believe a circuit that would be detecting if two pulses are received within a reasonable time frame and in the right order. I am inclining towards solving this on the hardware side to keep my MCU selection and Firmware design simple.

Does you have any suggestions?

Scope grab

EDIT Clarifications: 1. the truth table captures all the possible use cases. Trigger case is determined by the correct sequence of pulses and presence of both the pulses. All other input cases should result in output being low. 2. For MCU to wake up, I need a minimum pulse width of 10us. 3. Triggers are not expected frequently, may be once every hour. 4. Pulse width is max 1 sec for serviceable requests. 5. Rule 3, 4, 5 are also intended as sequential events - for example Red goes high but Blue doesnt after the trailing edge of Red; this wouldn't be a valid trigger.

\$\endgroup\$
7
  • \$\begingroup\$ Do pulses other than the ones you are looking for get emitted? What cases does the trigger case need to be distinguished from? And what does it take to wake up the MCU? \$\endgroup\$ Commented Apr 3, 2020 at 22:43
  • \$\begingroup\$ Great questions George! I should have clarified. No - the truth table captures all the possible use cases. Trigger case is determined by the correct sequence of pulses and presence of both the pulses. All other input cases should result in output being low. For MCU to wake up, I need a minimum pulse width of 10us. \$\endgroup\$ Commented Apr 3, 2020 at 22:50
  • \$\begingroup\$ When you get pulses grouped closely together, such as the last six pulses you show, how can you definitively tell which pulse follows which? Is there a guaranteed minimum time between the pairs of pulses? You also need to specify the maximum time pulses in the same pair. What do you mean by "on the hardware side"? It seems to me that using GPIO interrupts would be the best way to do this. \$\endgroup\$ Commented Apr 3, 2020 at 23:16
  • \$\begingroup\$ just a question should the pulses you have shown trigger it or not, they all seem to match rules 3,4,and 5 \$\endgroup\$ Commented Apr 4, 2020 at 0:37
  • \$\begingroup\$ @ElliotAlderson - Great question. There is no guaranteed minimum time but I dont expect frequency triggers (once every hr or so). In addition, one the MCU is servicing the request, it will be blocking any additional interrupts for next 2 mins. I will need to do some measurements, but based on the current data the pulse width is max 1 sec for serviceable requests. By the hardware side I meant preference to implement this logic in circuit rather than firmware (I am starved on GPIOs). \$\endgroup\$ Commented Apr 4, 2020 at 1:05

1 Answer 1

1
\$\begingroup\$

so, a D type flip flop with red on D input blue on the clock and blue on the inverted reset input.

eg: SN74LVC1G175

you will need need to stretch the red pulse a bit if you want to trigger off the pulses you have drawn.

a retriggerrable monostable like SN74LVC1G123 is probably a good choice as its power requirements are signioficantly less than thoise of a 555

\$\endgroup\$
4
  • \$\begingroup\$ Thanks Jasen. Pulse stretching is interesting as that allows a simple AND gate to work for this purpose. \$\endgroup\$ Commented Apr 4, 2020 at 1:17
  • \$\begingroup\$ with an and gate it will will give false triggering if the blue comes first and overlaps the red. \$\endgroup\$ Commented Apr 4, 2020 at 1:21
  • \$\begingroup\$ good point! AND gate wouldnt work. \$\endgroup\$ Commented Apr 4, 2020 at 1:25
  • \$\begingroup\$ Are there minimum and maximum limits on the gap time between red and blue? If so, a monostable triggered by red can act as a phase discriminator for blue. \$\endgroup\$
    – AnalogKid
    Commented Apr 4, 2020 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.