neazoi
Advanced Member level 6
- Joined
- Jan 5, 2008
- Messages
- 4,157
- Helped
- 13
- Reputation
- 26
- Reaction score
- 15
- Trophy points
- 1,318
- Location
- Greece
- Activity points
- 37,198
how to connect the cd4022? I get oscillations and the counter goes crazy.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
That is weird, thought it would be straight forward for such a simple circuit. The clock is simply a momentary switch to the vcc. The Clock inhibit and the reset are connected to the GND and the carry out is left unconnected. Only one of the outputs is connected, just to test the circuit and the others are left unconnected. The connected output seems to continuously switch on and off at a rate of about 10Hz or so. When I press the button (rising clock edge) the output stays even ON or OFF randomly, for as long as I keep the button pressed.I've seen your posts and know that you are experienced with electronics. So I know that you have taken care of decoupling capacitors, good grounding (earthing) practices, ensuring all unused input pins are terminated, etc, etc.
So............
In my experience, any counter that "goes crazy" is because the transitions are not clean.
Either: 1) there is high frequency noise during the transitions, or 2) those transitions are slow.
This is very simply corrected by adding a schmitt trigger between the input and the signal. If the signal is too noisy, you may require some filtering.
There is a pull-down resistor from clock to GND, right?The clock is simply a momentary switch to the vcc.
Ok I connected a 10k pull down resistor from clk to gnd.There is a pull-down resistor from clock to GND, right?
Otherwise, the clock input could pick up 50 (or 60) Hz from mains and the output would switch at 1/8 times that frequency except when the button is pressed, leaving the output at a stable level since the counter stops counting.
Regards
Z
Yes, the switch introduces a lot of bouncing. A debouncing circuit must be used.Or maybe the momentary switch introduces glitches that count as clock pulses themselves?
Since I intend in future to provide the clock from the LPT port of the PC (through software) would I still need the debounching circuit then?Yes, the switch introduces a lot of bouncing. A debouncing circuit must be used.
A simpe capacitor in parallel with the switch can work, but something a bit more sophisticated is more sure. Look for debouncing switch circuit.
Regards
Z
Yes indeed, I have tested it from the LPT and a debounching mechanism is not required. Level is not a problem on LPT since 5V is the HI, and if it is to be connected and disconnected some transients protection mechanism is needed. Alternatively if the clock pin is set to 0 after each clock pulse, then there is not a problem is the LPT port cable is disconnected and reconnected again!Not for debouncing, but some caution must be taken.
Care about level adaptation, assuring that the inputs are not left open in case the cable can be unconnected. Some protection against transients should be provided if the circuit can be hot-connected.
Regards
Z