40192 Up/Down Counter

Thread Starter

sni9er

Joined Oct 21, 2011
15
Thank you both for your valuble feedback, i'll draw up a new sketch today/tomorrow AM, with the SR NAND latch, as i have some spare from another sub-circuit
 

SgtWookie

Joined Jul 17, 2007
22,230
Here is a way to connect it up so that you have a bounceless switch, AND the counter advances when you press the button rather than when you release the button.

See the attached.

The red wires are at a logic 1, the blue wires are at a logic 0. Green wires are at an indeterminate value (neither 1 nor 0).
 

Attachments

MrChips

Joined Oct 2, 2009
29,794
Careful there Wookie. You're mixing CMOS and TTL.
CD4093B can only sink 0.51mA min, 1mA max.
The resistor load will be 0.5mA and the TTL gate is 0.2mA = 0.7mA. You've exceeded your min value.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Yes, I had to mix them because I didn't have the 40192 in the library. But you bring up a good point; they should not be mixed.
 

MrChips

Joined Oct 2, 2009
29,794
The other problem is by inverting the clock signal, you make the idle level LOW. Changing the UP/DOWN switch will cause the counter to count. You need to remove U1C.
 

SgtWookie

Joined Jul 17, 2007
22,230
Yes, changing the switch position will increment or decrement the count.

However, if you want the count to change when the switch is depressed using a simple circuit, that's the sacrifice one has to make.

Another approach could be to use a one-shot multivibrator.
 

Thread Starter

sni9er

Joined Oct 21, 2011
15
Do you think the on-shot multivibrator is a more solid solution, originally i used this circuit but then moved onto using ths inverters

either way i have adjusted my schematic:



I used a 555 as my One-Shot Multivibrator, i found a similar schematic online:

http://www.utm.edu/staff/leeb/3b3.htm

(bottom of the page)

I can use the 555 as a one-shot with no issues as space is currently not an issue on my vero layout, as ive spent the past few days tackling other issues and design considerations

thanks once again !
 

MrChips

Joined Oct 2, 2009
29,794
If you delete the third NAND gate the counter will change state AFTER you release the push button. If you want the counter to change when you press down on the button then you need a monostable. A 555 circuit will work but you can also do it with what you already have by adding a resistor and capacitor.
 

Thread Starter

sni9er

Joined Oct 21, 2011
15
as I already had my 555 setup on my breadboard, I plugged it back into the circuit

using a setup similar to that described by SgtWookie (with decade output to LED's rather than a 7-seg decoder)

my value jumps a number of places when switching the UP/Down switch

I also realised the function of the P-up resistors mean I can use a SPDT Switch rather than an DPDT for my up/down switch

for completeness here is an up-to date circuit diagram

 

Thread Starter

sni9er

Joined Oct 21, 2011
15
Hey guys

i have a solution, i thought i would share for any others huntng in a similar predicament

instead of a switch i have just made 2 Input Circuits one to each pin

i have inverted the output of the Schmidt trigger so the oppoosing pin will always be held high, allowing counting operation in both directions with 2 push switches !

i'll attach a full schematic soon
 

Thread Starter

sni9er

Joined Oct 21, 2011
15
haha @MrChips, i looked over that post, i dont see any suggestion for 2 input circuits one to each counter

maybe i missed it ? thanks anyway if you did !
 

MrChips

Joined Oct 2, 2009
29,794
Ha! You started out wanting a UP/DOWN selector toggle switch and one push button. You never asked for two push buttons.
If you wanted two push buttons in the first place all you had to do was duplicate the push button circuit shown in post #12, which I will post again here:

 
Top