2
\$\begingroup\$

I've made a circuit with 74HC109 JK flip flops. The purpose is to catch a pulse from two signals and for about 20 seconds keep the stored value (of which pulse came first). My problem is I need to reset the circuit, both at power up and later on. Unfortunately I don't know how to pull the /CLR lines without wrecking the /Q lines outputs. Grounding them when they are high, I suppose would cause the to draw a lot of current? Is it possible to solve by make a open collector coupling between the /Q and /CLR?

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Your circuit is not clear, I don't understand what the dashed lines mean. Are these additional inputs, namely /clr and /pre(load)? please clarify this part a bit. also, are you also willing to consider other topologies to achieve your goal? You are using JK ffs as T ffs for a start, and I sense there's room for improvement (if your current circuit works). \$\endgroup\$ – Vladimir Cravero Jan 20 '15 at 9:56
  • \$\begingroup\$ Yes, the dashed lines are for /CLR /PRE inputs which were missing in the editor. Yes I'm interested in other topologies. \$\endgroup\$ – Dejvid_no1 Jan 20 '15 at 10:05
3
\$\begingroup\$

I think using D flip flops with an asynchronous reset input can solve all your problems:

schematic

simulate this circuit – Schematic created using CircuitLab

How does this work? Let the top flip flop be A and the bottom one be B.

When you power your circuit you pull \$\overline{RST}\$ down so both flip flops hold zero value, that meaning that \$Q_{A,B}\$ are low an \$\overline{Q}_{A,B}\$ are high.

When A (B) toggles, \$Q_A\$ (\$Q_B\$) goes high because \$D_A=\overline{Q}_B\$ (\$D_B=\overline{Q}_A\$) was high, and of course \$\overline{Q_A}\$ (\$\overline{Q_B}\$) goes low. Now whatever happens to B (A) the circuit can't change state because \$D_B\$ (\$D_A\$) is low. Please note that if something happens to A (B), i.e. another pulse arrives, the circuit indeed changes state.

To reset everything just pull \$\overline{RST}\$ down.

This thing can work if A and B pulses can't come too near in time: i you press both buttons, or press them very fast, what this circuit is going to do is not specified.

Sorry for the ugly schematic but I could not figure out how to depict diagonal wires.

addendum if you need to use jk flip flops, because you have them lying around or because it's an homework question or because you just love jk ffs, you can build a D ff with a JK and a not port:

schematic

simulate this circuit

addendum 2: As Jasen pointed out in the comments, for this particular application the not gate isn't necessary since the input signals to the flip flops are available also in the negated form.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ you don't actially need the inverter, just use Q: Q1-K2 /Q1-J2 Q2-K1 /Q2-J1 \$\endgroup\$ – Jasen Jan 20 '15 at 12:32
2
\$\begingroup\$

This works:

enter image description here

And here are the data files you'll need to run an LTspice simulation if you want to. Download all of the files into the same folder and run the .asc file with LTspice.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Have you tried this in a real application? In actual HW? \$\endgroup\$ – Dejvid_no1 Jan 20 '15 at 13:24
  • \$\begingroup\$ @Dejvid_no1: What difference does it make? \$\endgroup\$ – EM Fields Jan 20 '15 at 13:35
  • \$\begingroup\$ @Dejvid_no1: I don't know whether you noticed, but my circuit includes Power On Reset, manual master reset, and ~ a 20 second lockout period where once either switch is pushed and its corresponding output goes hot, both switches are ignored until the 20 second timer (U2C, R4, C2) times out. Manual reset is never locked out, however, and the circuit can be manually reset at any time. \$\endgroup\$ – EM Fields Jan 20 '15 at 15:03
  • \$\begingroup\$ Yes, I noticed and will probably "steal" some of your ideas. Thanks. \$\endgroup\$ – Dejvid_no1 Jan 20 '15 at 15:21
-1
\$\begingroup\$

You are having problems because JK flipflops aren't the right functional block here. As Vladimir already pointed out, this can be more easily done with D flipflops.

However, another approach to consider is a small microcontroller. It would read all the inputs (only two in your example, but easily expanded to more) often, like every 10 µs. When one is found set, it sets the outputs accordingly and ignores the switch inputs until reset. In the very unlikely event that multiple inputs are found asserted at the same time, just randomly pick one of them.

The timing and logic can now be whatever you want it to be. This method also easily scales to more than two inputs. And, the actual hardware is simpler than a bunch of flipflops. You pretty much just need the micro and its bypass cap. Many micros have internal clocks and the option for internal pullups on some of the input lines. The rest is rather simple firmware.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks, this particular application prohibits the use of an microcontroller. Although it would make things a lot simpler! \$\endgroup\$ – Dejvid_no1 Jan 20 '15 at 13:50
  • 1
    \$\begingroup\$ @Dejvid: You might have mentioned that up front. \$\endgroup\$ – Olin Lathrop Jan 20 '15 at 13:53
  • 2
    \$\begingroup\$ Taking the time to peruse the data sheet reveals that an HC109 magically becomes a dflop just by connecting the J and Kbar inputs together and treating that junction like the D input of, say, an HC74. Also, advocating the use of an MCU without showing the code behind the application is exactly the same as advocating the use of hardware without showing the schematic, a la: "Just use an HC109 and an HC11", neither scenario being at all helpful to the querent, don't you agree? \$\endgroup\$ – EM Fields Jan 20 '15 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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