Replace volume buttons with a potentiometer

crutschow

Joined Mar 14, 2008
34,459
the question is do optical encoder pulses need de-bouncing? But if it is a mechanical encoder then probably they do.
I would say that optical encoder pulses likely don't, but mechanical encoder pulses definitely do.

Edit: Actually the FF circuits are insensitive to switch bounce so no de-bouncing circuit is needed.
 
Last edited:

Ya’akov

Joined Jan 27, 2019
9,170
x
Just how did you find that part,
its so specialised, Its amazing,

I was think having to use a PIC or even a Arduino !!
Search terms are an art, it seems.

I believe, based on the fact they talked about Microchip “programming and labeling“ some of the SMD versions because of their (Elm’s) limited production capacity that these are ATTinyXXs. Which is a goo way to create a product like this for sale.
 

MisterBill2

Joined Jan 23, 2018
18,568
At $8.50 EACH these cost almost ten times as much as the CD4027 Dual JK flipflop IC, which is available from many manufacturers. The only real benefit is the smaller package. And neither one will fit on the circuit board.
 

drjohsmith

Joined Dec 13, 2021
852
At $8.50 EACH these cost almost ten times as much as the CD4027 Dual JK flipflop IC, which is available from many manufacturers. The only real benefit is the smaller package. And neither one will fit on the circuit board.
Could you highlight please how would one implement denounce of a cheap rotary encoder with a 4027 ?
 

MisterBill2

Joined Jan 23, 2018
18,568
Could you highlight please how would one implement denounce of a cheap rotary encoder with a 4027 ?
The debounce portion can be identical to what Crutschow shows in post #16. The CD4027 is a DUAL FF and so only one IC is required. It is positive true on al inputs so the rest of the circuit is a bit different from that post. But the functions are similar to the description. Unfortunately I am not able to provide a drawing, but severa others are very well able to provide one.
 

crutschow

Joined Mar 14, 2008
34,459
The CD4027 is a DUAL FF and so only one IC is required.
Don't think so.
Since the CD4027 is a JK flip-flop with a logic-high reset and a standard clock input, and the 74HC74 is a D flip-flop with logic-low reset and a Schmitt-trigger clock input, you will need a minimum of an added inverting Schmitt-trigger gates IC package to do the debounce and get the proper operation.

So if you want to use two CD4000 ICs instead of one 74HC74, below are the LTspice simulations of two quadrature decoder circuits. the first using one dual CD4013 D-FF package, the second using one dual CD4029 JK-FF package, with both using one hex CD4106 Schmitt-trigger inverter package:

1646110541853.png
=============================================================================================

1646114541333.png
 
Last edited:

crutschow

Joined Mar 14, 2008
34,459
After some more thought I realized that you do not need debounce for the circuit, since the FF will not change states after the first switch bounce for either the clock or the Set/Reset inputs, since the D input is stable when the clock pulse(s) occurs.

By inverting some of the logic, I was able to modify the circuit so it doesn't need any inverters, thus it uses just one FF package.

So here's the simulation of the CD4013 circuit with no debounce circuit and no inverters:
But I could not determine how to do it with a JK FF without inverters.


1646193758771.png
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,568
After some more thought I realized that you do not need debounce for the circuit, since the FF will not change states after the first switch bounce for either the clock or the Set/Reset inputs, since the D input is stable when the clock pulse occurs.

By inverting some of the logic, I was able to modify the circuit so it doesn't need any inverters, thus it uses just one FF package.

So here's the simulation of the CD4013 circuit with no debounce circuit and no inverters:
But I could not determine how to do it with a JK FF without inverters.


View attachment 261892
It is taking a bit to visualize the operation of this circuit, that is certain. It takes a bit to realize that the preset state is used as the non-active state. Certainly this is an elegant solution, although it takes a bit of time to figure how it is working.
It is a bit like the J-K scheme which I do not recall just how I made that one work, that was 30 years ago, at least.
 

crutschow

Joined Mar 14, 2008
34,459
It is a bit like the J-K scheme which I do not recall just how I made that one work
The D circuit uses inverted logic as you noted (high is logic 0 with the signal at /Q out), which works since the D input also works inverted.
The problem is that the JK inputs do not work inverted, so don't see how the it would operate without an added inverter. :confused:
 
Last edited:
Top