De-bounce circuit not working as expected

ebp

Joined Feb 8, 2018
2,332
Try adding a "noise" (sine or square) would do of a volt or so in series between the capacitor and the clock input of the flip flop - and be sure the ff model does not have a schmitt trigger. Simulations generally assume everything is neat and clean. Reality is different.

I'll wager the sim model for the ff is a "block with I/O" type and not a full simulation of internal circuitry, and therefore makes invalid assumptions.

Try a sim with a triangle wave clock with a slew rate of a 10 volts per millisecond. The flip flop will probably work, but the clock is well out of spec for any part without a schmitt trigger.

~~~
The diode in the circuit at #1 is apparently there to speed up charge of the capacitor to get a fast rise on clock. That is why I say get rid of both R1 and D1 and net effect will, for practical purposes, be the same. There is just no getting around the fact that it is a bad design unless the clock input has a schmitt trigger.
 

Thread Starter

recklessrog

Joined May 23, 2013
985
hi Roger,
Running the same sim with 10V and stepping the R2 value fro 100 thru 10k, gives no problems.
E
Here is a photo of how I'm connecting it, for clarity I have removed some decoupling capacitors that were across the ic's so that you can see them.
A.JPG strange how sim works ok, but not in practice, yet the other circuit I showed is how it is used in a guitar effects pedal
 

ericgibbs

Joined Jan 29, 2010
21,442
hi ebp,
I aware of that fact, but I suggest it would be prudent to try an alternative switch, in view of the unusual failure of his circuit.
I have lost count of the times I have heard the expression, this or that should not happen.
E
 

ebp

Joined Feb 8, 2018
2,332
The TI datasheet for the 4027 specifies a maximum rise and fall time for the clock of 5 µs with Vdd of 10 volts.
 

ebp

Joined Feb 8, 2018
2,332
It looks like rog is using HEF4027s (are both the same? - one at the top of the board looks different), so now the question is "is it a version with hysteresis at the clock input?" Behavior suggests it isn't.
 

Thread Starter

recklessrog

Joined May 23, 2013
985
There are a looooot of different JK flipflops out there, and eric's circuit in #14 is more reliable than the circuit in #1.

Also, D1 is in backwards in both circuits. Given that current limiting resistor R1 is only 5% of timing resistor R2, and this is not a critical timing situation, I don't think the diode is needed at all. But if it's gonna be in there, it should be oriented to do something useful.

ak
Thanks, I reversed the diodes and used 10k resistors. On one of the 4027's it now works fine, but on the second one, it still needs to be 1k or it just reverts to previous state.
Is it anything to do with the one that works with 10k resistors is a RCA 4027ae and the one that requires 1k is an HEF4027p?
 

Thread Starter

recklessrog

Joined May 23, 2013
985
hi ebp,
I aware of that fact, but I suggest it would be prudent to try an alternative switch, in view of the unusual failure of his circuit.
I have lost count of the times I have heard the expression, this or that should not happen.
E
I have tried different switches and it's the same, I removed the diodes and the RCA 4027ae works fine with 10k with or without the diode, the HEF 4027 works with or without the diode as long as the resistor (R1) is 1k.
 

Thread Starter

recklessrog

Joined May 23, 2013
985
Is there any reason to not just use 1k for R1 seeing as it works in every case? The circuit That Eric supplied in post #14 seems better than the original.
 

AnalogKid

Joined Aug 1, 2013
12,139
Is there any reason to not just use 1k for R1 seeing as it works in every case?
Depends on the switch. 1K and 10 Volts means that the switch sees 10 mA into the pull down resistor plus the transient current into the capacitor. Little tact switches are disgustingly low cost partly because of their low contact current rating brought on by very thin contact plating. What is the contact current rating for the switch you are using?

ak
 

Thread Starter

recklessrog

Joined May 23, 2013
985
Depends on the switch. 1K and 10 Volts means that the switch sees 10 mA into the pull down resistor plus the transient current into the capacitor. Little tact switches are disgustingly low cost partly because of their low contact current rating brought on by very thin contact plating. What is the contact current rating for the switch you are using?

ak
Yes they are horrible things and the rating is something I don't know, I do have some much better quality momentary panel mount push buttons. I'm wondering about maybe putting a resistor in series with the switch, I will give it a try.
I'm still puzzled by the difference between the two 4027's.
 

ebp

Joined Feb 8, 2018
2,332
The HEF part from Philips did have a schmitt at the clock input in the
There are a looooot of different JK flipflops out there, and eric's circuit in #14 is more reliable than the circuit in #1.

ak
Why should it be any more reliable? Functionally it is identical.
 

ebp

Joined Feb 8, 2018
2,332
There are significant differences in A and B series 4000 parts. The B series obsoleted the A series several decades ago. Once again, unless the clock input has an internal schmitt trigger, you are not entitled to expect the circuit to work properly. It will not meet clock slew rate requirements.

I'll try to dig out a Signetics CMOS databook that should have specs for the original HEF4027B. EDIT - circa 1983 it did have a schmitt at the input. I don't recall if there where second sources for the HEF series. I can't see a logo on rog's chip.
 
Last edited:

Thread Starter

recklessrog

Joined May 23, 2013
985
I have just found that RS components have 4013's in stock now so I will order some to use if necessary.
I would still like to resolve the 4027 problem though.
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi Roger,
Can you check the voltage level at the 4027 clock pin, when the P/B is not pressed.?
Also can you confirm that the P/B are normally Open contacts.?
E
 
Top