flip-flop question

I'm designing a circuit and I need something to switch between two inputs. I don't have very much experience, but I think a certain type of flip-flop will do this?

I'm using a 555 (as a monostable vibrator), and I need the same momentary push button to toggle between the trigger and the reset lines. Basically it's like a metronome with a single start/stop switch.

Can I do this with a flip-flop?

Reply to
razorboy
Loading thread data ...

Why not build an astable multivibrator with the 555? You will then get a constant stream of ticks.

Or post your schematic on alt.binaries.schematics.electronic

Reply to
Lord Garth

I need to be able to start/stop the ticks. From what I've seen you can't really do that with astable. Am I correct?

Reply to
razorboy

I need to be able to start/stop the ticks. From what I've seen you can't really do that with astable. Am I correct?

No, you can drive the reset input and stop the oscillator with a simple toggle switch.

Reply to
Lord Garth

If I get you, I think you want to enable/disable the 555 using the same pushbutton, is that right?

If so, you can use a couple of inverters (cmos 4049 perhaps) along with a normally open push button and and resistors/capacitors to do this.

.-----------------------------------------. | | | |\\ ___ |\\ ___ | '----| >O-|___|--o----| >O----o---|___|---' |/ 100k | |/ | 100k | | 4049 | 4049 .-. | | | 330k | | | | T '-' | --- | '-----o o----o | --- 1uF --- | | === GND (created by AACircuit v1.28.6 beta 04/19/05

formatting link

The pushbutton is normally open. The capacitor is charged to the output of the right inverter. When you push the button, it changes the value of the input of the right inverter, causing it to change its output. This is independent of the starting state.

Use the real output (not the output after the 100k resistor) to drive the reset of the 555.

Regards, Bob Monsen

Reply to
Bob Monsen

The only constraint I have for this circuit is the momentary switch for user input.

Reply to
razorboy

=A0 =A0 =A0 =A0 |

=A0 =A0|

=3D

That looks great, but where do I put the trigger and reset lines from the 555?

Reply to
razorboy

The only constraint I have for this circuit is the momentary switch for user input.

Okay, a T flip flop with a debounced push button switch as its clock input. The output goes to the reset input of the 555.

You can form a T flip flop if you take a D flip flop and connect the Q* output back to the D input.

Reply to
Lord Garth

What do I connect the trigger input of the 555 to? The D input of the flip-flop?

Reply to
razorboy

That looks great, but where do I put the trigger and reset lines from the 555?

You set up the 555 as an astable multivibrator, and let it free run. You connect this to the reset pin of the 555. When it is "high" output, the 555 will output pulses for you. When it is "low" output, the 555 will wait for a "high" output, and output no pulses.

The typical setup for an astable is to have two resistors and a capacitor. Connect the resistors in series with the capacitor between the voltage supply and ground. Connect the discharge pin between the resistors, and both the 'trigger' and 'threshold' to the cap:

-----------o-----------------. Vcc(12v) | | | .-. | | | R1 | | | | __ '-' '---o| |o-----. | .----o| |o-----)--o output ----)----o| |o---. | | reset ----)----o|__|o- | | .-. | | | | | R2 | | | | | | | | '-' | | | | '-------------o-)--o | | | --- C1 | --- | | GND | | ---------------------------o--'

1/f = discharge time through R2 + charge time through R1 + R2

Discharge through R2 is .693 * R2 * C Charge through R1 and R2 is .693 * (R1 + R2) * C

So, f = 1.44/(R1*C + 2*R2*C) and d = 100 * R2 / (R1 + R2)

(created by AACircuit v1.28.6 beta 04/19/05

formatting link

Regards, Bob Monsen

Reply to
Bob Monsen

What do I connect the trigger input of the 555 to? The D input of the flip-flop?

It's an astable multivibrator...build that first, get it oscillating then work on holding the reset active to stop it.

Reply to
Lord Garth

--- Yes. Assuming you're talking about digital inputs and outputs, the whole thing can be done with a dual "D" type flip-flop and three NAND gates. View in Courier:

C1 Vcc>-+-[100nF]-+--------+-------+ | | |R1 | | | [1MR] | IN1 +---+ | | | | 4011 | | | U1a GND | U1b +-B U2a S1| O | +--+--+ +--+--+ NAND Y--+ | O +--|D S Q|-----+----|> S Q|------A | | | | | | _| +--A +------|> R | | +-|D R Q|-+ NAND Y-->OUT | +--+--+ | | +--+--+ | +--B U2c [10K] 4013| | +----|----+----B | |R2 +--[Rt]--+ | NAND Y--+ | | | | +-A U2b | +-[CR1>]-+ | | | [Ct] | | | | | IN2 GND>-+---------+----------------+ Select Rt and Ct for a time constant longer than the press-release cycle of S1.

On power-up, the S(et) inputs of U1a and B are pulled high momentarily by C1 and R1, forcing U1a-Q high, U1b-Q high and U1b-Q\\ low.

Since the signal on U1a-S will stay high longer than the edge from U1a-Q, U1b-Q will remain high and U1b-Q\\ will remain low until U1a times out and S1 is pressed.

U2a, b, and c comprise a 2-to-1 multiplexer, and with U1a high and U1b low, the logic signal appearing on IN1 will appear on OUT until S1 is pressed.

When S1 is pressed, U1a-Q will go high and will toggle the outputs of U1b, now causing the signal on IN2 to appear on OUT.

When U1a-Q goes high it also starts charging Ct through Rt, and when the voltage on U1a-R gets high enough it will reset U1a and discharge Ct quickly through CR1, which can be any common signal diode, say a

1N4148.

After that, every time S1 is pressed the cycle will begin anew and the signal on OUT will alternate between the signal on IN1 and IN2.

If you decide to build this circuit, be sure to connect the inputs of the unused NAND to either Vcc or GND.

Reply to
John Fields

On Tue, 25 Mar 2008 09:09:06 -0500, John Fields wrote:

--- Version 4 SHEET 1 2244 800 WIRE 64 -272 -32 -272 WIRE 224 -272 128 -272 WIRE 352 -272 224 -272 WIRE 880 -272 352 -272 WIRE 1024 -256 752 -256 WIRE 1280 -240 1120 -240 WIRE 352 -224 352 -272 WIRE 880 -224 880 -272 WIRE 1440 -192 1344 -192 WIRE -32 -176 -32 -272 WIRE 272 -176 -32 -176 WIRE 528 -176 432 -176 WIRE 608 -176 528 -176 WIRE 704 -176 608 -176 WIRE 752 -176 752 -256 WIRE 800 -176 752 -176 WIRE 1280 -176 960 -176 WIRE 1536 -144 1504 -144 WIRE 272 -128 96 -128 WIRE 480 -128 448 -128 WIRE 528 -128 528 -176 WIRE 608 -128 608 -176 WIRE 704 -128 704 -176 WIRE 800 -128 704 -128 WIRE 1024 -128 1024 -256 WIRE 1024 -128 976 -128 WIRE 1280 -128 1024 -128 WIRE 1440 -128 1392 -128 WIRE 1392 -112 1392 -128 WIRE 1392 -112 1344 -112 WIRE 1280 -64 1248 -64 WIRE 352 -16 352 -80 WIRE 528 -16 528 -64 WIRE 528 -16 352 -16 WIRE 608 -16 608 -48 WIRE 608 -16 528 -16 WIRE 1536 0 1536 -144 WIRE -32 16 -32 -176 WIRE 96 16 96 -128 WIRE 224 16 224 -272 WIRE 480 16 480 -128 WIRE 1120 16 1120 -240 WIRE 1248 16 1248 -64 WIRE 608 32 608 -16 WIRE -32 144 -32 96 WIRE 96 144 96 96 WIRE 96 144 -32 144 WIRE 224 144 224 96 WIRE 224 144 96 144 WIRE 480 144 480 96 WIRE 480 144 224 144 WIRE 608 144 608 96 WIRE 608 144 480 144 WIRE 880 144 880 -80 WIRE 880 144 608 144 WIRE 1120 144 1120 96 WIRE 1120 144 880 144 WIRE 1248 144 1248 96 WIRE 1248 144 1120 144 WIRE 1536 144 1536 80 WIRE 1536 144 1248 144 WIRE -32 176 -32 144 FLAG -32 176 0 SYMBOL voltage 96 0 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 5 0 1e-6 1e-6 1 2) SYMATTR InstName V2 SYMBOL voltage -32 0 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value 5 SYMATTR InstName V1 SYMBOL res 592 -144 R0 SYMATTR InstName R1 SYMATTR Value 1e6 SYMBOL cap 592 32 R0 SYMATTR InstName C1 SYMATTR Value 1e-6 SYMBOL Digital\\\\dflop 352 -224 R0 SYMATTR InstName A1 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL res 464 0 R0 SYMATTR InstName R2 SYMATTR Value 10k SYMBOL diode 544 -64 R180 WINDOW 0 24 72 Left 0 WINDOW 3 24 0 Left 0 SYMATTR InstName D1 SYMATTR Value 1N4148 SYMBOL Digital\\\\dflop 880 -224 R0 SYMATTR InstName A2 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL res 208 0 R0 SYMATTR InstName R3 SYMATTR Value 1e6 SYMBOL cap 128 -288 R90 WINDOW 0 0 32 VBottom 0 WINDOW 3 32 32 VTop 0 SYMATTR InstName C2 SYMATTR Value 1e-8 SYMBOL Digital\\\\and 1312 -272 R0 SYMATTR InstName A3 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL Digital\\\\and 1472 -224 R0 SYMATTR InstName A5 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL Digital\\\\and 1312 -32 M180 SYMATTR InstName A6 SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v SYMBOL res 1520 -16 R0 SYMATTR InstName R4 SYMATTR Value 10k SYMBOL voltage 1248 0 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 5 0 1e-6 1e-6 .25 .5) SYMATTR InstName V3 SYMBOL voltage 1120 0 R0 WINDOW 3 24 104 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 5 0 1e-6 1e-6 .1 .2) SYMATTR InstName V4 TEXT 48 192 Left 0 !.tran 5 TEXT 48 232 Left 0 !.option noopiter

Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.