Flip flop question

Thread Starter

jaygatsby

Joined Nov 23, 2011
182
I want a flip flop to trigger between 1 and 0 each time it receives a 5V pulse (from a button pushed on a keypad.) Otherwise I want it to stay in its current state, even when the keypad is disconnected and the input floats. I was thinking of using a flipflop, with the input tied via a pull up/down (depending on state) resistor to its output. What sort of flip flop is best for this application?

Thank you
 

w2aew

Joined Jan 3, 2012
219
I want a flip flop to trigger between 1 and 0 each time it receives a 5V pulse (from a button pushed on a keypad.) Otherwise I want it to stay in its current state, even when the keypad is disconnected and the input floats. I was thinking of using a flipflop, with the input tied via a pull up/down (depending on state) resistor to its output. What sort of flip flop is best for this application?
A JK Flip Flop will work, with both the J and K inputs tied high. The output will toggle on the rising clock edge.
 

praondevou

Joined Jul 9, 2011
2,942
The 4013 will do it too. Connect /Q to the data input, SET and RESET to GND and the CLOCK input to your input signal.
Also put a pull-down resistor to the Clock input to be able to disconnect the input.
 

crutschow

Joined Mar 14, 2008
34,427
As noted by praondevou, a D-FF will also work if you tie the D input to the /Q output. Make sure all the unused inputs are tied to Vcc or gnd as appropriate.

You will need to add a debounce circuit to the button output (if it doesn't already have one) to avoid multiple triggers.
 

Wendy

Joined Mar 24, 2008
23,421
The key is the difference between nonvolatile and volatile memory. The vast majority of flip flops are volatile, disconnect power and reconnect they have lost the information. This true of computers too.

SD cards, hard drives, and thumb drives are nonvolatile. They do not require power to hang on to their information. They are also not flip flops either.

What you probably want is a battery backup, just like the one for an alarm clock, to keep the state active when the power supply is off. Since a CMOS gate (like the 4013) draws nanoamps a simple battery arrangement could last for years.
 

Thread Starter

jaygatsby

Joined Nov 23, 2011
182
Power will be applied to the device -- just the keypad unit will be unplugged from the main unit. So I want the information the keypad has told the main unit to remain 'in memory', and I think I can do this using the techniques above.

Thanks
 
Top