Momentary Power Button Circuit/ Single D flip flop question
groggory
Posts: 205
Could you guys verify that this circuit makes sense? I don't have time to proto it up first and will be committing it to PCB.
http://www.discovercircuits.com/H-Corner/on-off-switch.htm
I don't have a very good understanding of how the Single D positive edge flip flop works. :-/
If anyone could explain how that chip (sn74lvc1g79) works that would be even better! It looks neat but I need a teacher here.
Thank you.
http://www.discovercircuits.com/H-Corner/on-off-switch.htm
I don't have a very good understanding of how the Single D positive edge flip flop works. :-/
If anyone could explain how that chip (sn74lvc1g79) works that would be even better! It looks neat but I need a teacher here.
Thank you.
Comments
The flip flop output (Q) is being changed by the button push since the input (D) will be in the opposite state of that output. So, when off, Q will be low which is inverted by Q1 making the input D high. Pushing the button will drive the output (D) high to match the input and will turn on Q2. With the output high, the input is low, so the next button push will cause the output to go low, turning off Q2.
Check out the function table on page 2 of the datasheet:
http://focus.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=sn74lvc1g79&fileType=pdf
You can see that if D is the opposite of Q (output) it will change states with each clock cycle (in this design, a button push/release is the "clock cycle")
Before making your own, have you seen the equivalent from Pololu? I don't know how they claim it to be "patented" but it's a nice one.
http://www.pololu.com/catalog/product/751
Δt/ΔV input transition rise and fall rate @VCC = 2.7 V to 5.5 V = 10 ns/V maximum.
The clock input is being pulled up with a 1M resistor to discharge a 0.1uF cap. With its 100 ms time constant, that rise rate is well above 10ns/V.
Obviously, you need some debouncing on an edge-triggered input. The preferred method of doing this would interpose a Schmitt trigger between the RC circuit and the clock input, thus guaranteeing a snap action rise on the clock signal.
-Phil
first post for quite a while....
The rise time is only a problem with metastability and possible noise on the outputs but for this application it doesn't matter. A simpler way would be to just have the button turn on the MOSFET directly and then have the Prop lock it on. There is a minimum amount of time that the button needs to be pressed though until the Prop has booted. That way the Prop can turn the power back off when it's ready or else it can sense the state of the button for manual turnoff.
A small SOT-23 PIC is also a clean and foolproof way to do it.
(I don't know what could be possibly "patented" about the simple Pololu circuit though, just looks like a regular PIC micro programmed to debounce and toggle, duh.)
It's a start, but you should flip to this similar device
http://ics.nxp.com/products/lvc/datasheet/74lvc1g74.pdf
Why ?
It Eliminates R2,R3,C2,Q1 as it has a /Q pin, and the NXP data says
"Schmitt trigger action at all inputs makes the circuit highly tolerant of slower input rise and
fall times."
so that means it will tolerate the slow clock rise.
It is also good practice to add a series R to the switch, so you do not short the cap C1 - that can corrode the switch faster.
It's very instructive to wire something like this up, grab a scope, figure out what's wrong, and then try different fixes. (Eventually you realize this is only a small part of a much larger circuit, and then you finally end up replacing the whole circuit with a single propeller chip with the switch feeding an input pin and do all the debouncing, etc. in software.)
I think I'll program up a pic to do some switch functions like this for me then have the pic control some mosfets and indicator LEDs. That's probably the real way to go. Discreet logic is just so set in stone compared to software.
with the right caps does this handily. Try and figure it out yourself first; it's not
too hard and can be gratifying.
If you don't know about the standard cross-coupled transistor multivibrator circuits,
do a simple google search to see what you can do.
Got it.
http://www.electronics-tutorials.ws/waveforms/bistable.html
http://www.electronics-tutorials.ws/waveforms/tim17.gif