Wednesday 20 August 2014

generator - How do I build a one shot non-retriggerable pulse generation circuit with 2 triggers?


I'm kind of a noob when it comes to electronics (I'm mainly a computer programmer), so please bear with me. I want to construct a one shot non-retriggerable pulse generation circuit that has two trigger inputs. The inputs on the triggers are going to be persistent signals (not just pulses) so I would like the circuit to only generate a pulse when one of the input lines is pulled high, and not generate another one until either the second input line also gets pulled high, or the first input gets pulled low and then high again (this behavior may be easier to achieve by using two pulse generators and tying the outputs together, but in this case it is still important that each pulse generator only fire a pulse when the trigger signal goes from low to high, and not continue to generate pulses if the signal then remains high for a while).


The reason the trigger signal may remain high for a while is because the triggers are going to be user-operated. For example, let's say that each trigger is connected to a button, and the output is connected to an LED (just an example, not what I actually intend to use this circuit for). If the user presses either button, the LED should flash once, regardless of whether the user continues to hold down the button after pressing it. If the user then presses the second button while still holding down the first one, the light should flash a second time; the light should not flash again until the user releases at least one of the buttons and then presses it down again.


I hope I'm making myself clear as to what I need this circuit to do. As I said before, I am mainly a computer programmer, so I will provide some pseudo-code below if it helps to understand what I am asking.


IF (trig1.prevState = 0 AND trig1.currentState = 1) OR (trig2.prevState = 0 AND trig2.currentState = 1) THEN 
output.currentState <- 1

ELSE
output.currentState <- 0
ENDIF

I am not against using a microcontroller, but only if the delay it introduces is negligible (I need the pulse to occur nearly the instant the trigger line is pulled high).


As I said, I'm kind of a noob, so I would really appreciate it if someone could provide a full schematic of the best way to build this circuit, although any suggestions at all are still welcome. I don't want this to be too expensive, so no super expensive parts please.



Answer



Here's a really cheap, simple way to do it in hardware; no code, no debounce, no input-to-output delay, it just works.


TRIGA is one high-going input, TRIGB is the other, and OUT is, well, the output.


enter image description here



No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...