Need A Help in deriving a clock for 4017

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Hi All,

I need to clock the 4017 counter from two paths .
#one from push button (the distance between the button and the counter 20 M)
#and the other one from mcu ..

does the circuit below satisfy what i need or need to add more elements ?


6-19-2017 5-30-46 PM.jpg


Regards :)
 

dl324

Joined Mar 30, 2015
16,922
If you can't guarantee that the MCU and switch will ever be in conflict, you should use a gate instead of wire OR'ing.

The switch will require debouncing.
 

MrChips

Joined Oct 2, 2009
30,808
Definitely not.
Firstly, you need to debounce your push button.
Secondly, you need special drivers in order to send the signal over 20m. You might want to consider current loop or RS-232/RS-422/RS-485 driver/receiver.

Then you need a way or OR'ing the two signals such as open collector, open drain, tristate, diodes, wired-OR, digital OR gate.
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Thanks All :)

only the switch is far away about 20 M from the counter but the resistor and the debounce circuit will be closed to the counter .
So still need a driver ?
 

AnalogKid

Joined Aug 1, 2013
11,044
The 4017 clock input advanced the count on the positive-going edge. If you want to use a grounded switch as shown, tie the clock input to Vdd and drive the Enable input with a negative-going edge. The 4017 internal schematic shows that this will work.

What is the power supply voltage?

ak
 

crutschow

Joined Mar 14, 2008
34,450
Here's the simplest circuit I could come up with.
It uses the inhibit input for the MCU clock and a large RC filter on the PB line to debounce the switch and suppress noise pickup.
The simple RC debounce will work since the CD4017's clock input is insensitive to clock rise and fall time as shown below.
The one possible disadvantage of this simple circuit is that it triggers on the release of the push-button, not when it's pressed.

upload_2017-6-19_11-19-15.png

upload_2017-6-19_11-24-43.png
 

AnalogKid

Joined Aug 1, 2013
11,044
Do u mean as seen in circuit below ?
R5 can be deleted because R6 and R7 limit any external currents.

Your debounce period is less than 1 ms. Increase C4 to 10 uF for more effective debouncing.

When both inputs are off pin 14 will float, a CMOS no-no. Add a 10K pull down resistor from pin 14 to GND.

ak
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Here's the simplest circuit I could come up with.
It uses the inhibit input for the MCU clock and a large RC filter on the PB line to debounce the switch and suppress noise pickup.
The simple RC debounce will work since the CD4017's clock input is insensitive to clock rise and fall time as shown below.
The one possible disadvantage of this simple circuit is that it triggers on the release of the push-button, not when it's pressed.

View attachment 129300

View attachment 129301
R5 can be deleted because R6 and R7 limit any external currents.

Your debounce period is less than 1 ms. Increase C4 to 10 uF for more effective debouncing.

When both inputs are off pin 14 will float, a CMOS no-no. Add a 10K pull down resistor from pin 14 to GND.

ak

Thank you for your appreciated effort ^^
I will try the circuit soon then post the result :)
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
thanks all :)

so the circuit become like this ?

ghl.jpg

R5,R6,R7 and C4 should be close to switch(20 m from the counter) or should be close to 4017 ?

Regards :)
 

MrChips

Joined Oct 2, 2009
30,808
Components go close to 4017.
Note that the connection to the pushbutton is via 20m length of paired wires (i.e. 2-conductor cable).

Hook it up and try it out.

What you are looking for are:
1. Does pressing the pushbutton cause a transition of 4017?
2. Do you get a single increment or multiple increments (i.e. switch bounce)?
 
Top