7943 (SN74HC393N) not working how I expect it to

Thread Starter

JeroenJK

Joined Dec 9, 2015
7
Hi all,

Next semester I am switching from Software Engineering to Embedded Systems and Automation, with digital electronics. Last month I bought all sorts of logic-gate IC's on ebay, and some other IC's where I want to experiment with. (I still don't have a good idea what to do, so if you have suggestions, please let me know! ;))

I also have a 7943-IC, a dual 4-bit counter. Datasheet: http://www.ti.com/lit/ds/symlink/sn74hc393.pdf
I use the Arduino as power-source. I connected the following pins:
- pin 14 (Vcc) to 3.3v
- pin 7 (gnd) to GND (makes sense)
- pin 8/9/10/11 to the + of 4 LEDs (the - of the LEDs to GND)

Then when I give manual pulses of 3.3v to pin 13 (CLK) by pushing a button it should count, right? But all leds stay off.

Can someone point me in the right direction and explain me what I am doing wrong? Or is it just broken?

Thanks!
 

JohnInTX

Joined Jun 26, 2012
4,787
Welcome to AAC!
Please post a schematic (hand drawn is OK) of your circuit and we will be in a better position to help.
 

dl324

Joined Mar 30, 2015
16,922
Your first post; welcome to AAC!

If you post a schematic, it will eliminate ambiguity and make it be easier for people to help you.

EDIT: @JohnInTX beat me by seconds...
 

dl324

Joined Mar 30, 2015
16,922
I also have a 7943-IC, a dual 4-bit counter. Datasheet: http://www.ti.com/lit/ds/symlink/sn74hc393.pdf
You need to be more specific. In electronics, a single character can make a big difference. Logically, 7493 and 74HC393 are equivalent; but they differ in supply voltage range, power, speed, input/output requirements, ...
I use the Arduino as power-source. I connected the following pins:
- pin 14 (Vcc) to 3.3v
- pin 7 (gnd) to GND (makes sense)
- pin 8/9/10/11 to the + of 4 LEDs (the - of the LEDs to GND)
7493 are not spec'ed to operate with VCC lower than 4.5V.

Unused inputs need to be tied to an appropriate supply.

The datasheet you linked to is terrible. Sadly it's from TI and they should know better; my TI databook from the 70's is much better. Guess they had too much brain drain when older workers retired...

Then when I give manual pulses of 3.3v to pin 13 (CLK) by pushing a button it should count, right? But all leds stay off.
How do you have reset and clock connected? Reset is HIGH active and needs to be tied LOW. Clock is LOW active, so probably needs a pull down resistor; depends on how the manual pulses are being delivered.
 

crutschow

Joined Mar 14, 2008
34,452
Rule #1 (or at least near the top) is that all unused inputs of a CMOS circuit must be tied high or low, or the circuit may operate in a flaky manner.

Next, if you use a mechanical switch to generate a clock signal, it must be connected to a debounce circuit to avoid multiple clock pulses.
 

GopherT

Joined Nov 23, 2012
8,009
And, LEDs and other diodes have essentially no resistance. So, when you feed an LED +5 volts and connect the other end to ground, you will either burn out the LED or burn out the logic pin sending the +5 volts through the LED.

LEDs are generally limited to 25 mA max. Logic pins anywhere from 0.5 to 10 mA (but check the datasheet - there aree so many different versions that there is no rule-of-thumb). In any case, you need to put some resistance (330 to 1k) between the diode and ground (or between the logic output pin and the diode).

At this point, it is completely possible that your logic pins or diodes are burnt out. Test them with a 5v supply and a 330 to 1k resistor in series. good luck and have fun smoking some parts as you learn. Biggest thing to learn is what did you do wrong when you see the smoke come out of a part. In case you don't know yet, it is magic smoke - that is the stuff that makes the part work. Once it is gone, the part will no longer work.
 

dl324

Joined Mar 30, 2015
16,922
Here's the function table from an OnSemi datasheet; TI used to include them too...
upload_2016-1-6_12-46-37.png
With the TI datasheet, I had to look at the logic diagram...
upload_2016-1-6_12-48-45.png
I'm not sure if the clock input on the first flop should have a bubble or not...
 

hp1729

Joined Nov 23, 2015
2,304
Hi all,

Next semester I am switching from Software Engineering to Embedded Systems and Automation, with digital electronics. Last month I bought all sorts of logic-gate IC's on ebay, and some other IC's where I want to experiment with. (I still don't have a good idea what to do, so if you have suggestions, please let me know! ;))

I also have a 7943-IC, a dual 4-bit counter. Datasheet: http://www.ti.com/lit/ds/symlink/sn74hc393.pdf
I use the Arduino as power-source. I connected the following pins:
- pin 14 (Vcc) to 3.3v
- pin 7 (gnd) to GND (makes sense)
- pin 8/9/10/11 to the + of 4 LEDs (the - of the LEDs to GND)

Then when I give manual pulses of 3.3v to pin 13 (CLK) by pushing a button it should count, right? But all leds stay off.

Can someone point me in the right direction and explain me what I am doing wrong? Or is it just broken?

Thanks!
What is the Clear input doing?
 

hp1729

Joined Nov 23, 2015
2,304
And, LEDs and other diodes have essentially no resistance. So, when you feed an LED +5 volts and connect the other end to ground, you will either burn out the LED or burn out the logic pin sending the +5 volts through the LED.

LEDs are generally limited to 25 mA max. Logic pins anywhere from 0.5 to 10 mA (but check the datasheet - there aree so many different versions that there is no rule-of-thumb). In any case, you need to put some resistance (330 to 1k) between the diode and ground (or between the logic output pin and the diode).

At this point, it is completely possible that your logic pins or diodes are burnt out. Test them with a 5v supply and a 330 to 1k resistor in series. good luck and have fun smoking some parts as you learn. Biggest thing to learn is what did you do wrong when you see the smoke come out of a part. In case you don't know yet, it is magic smoke - that is the stuff that makes the part work. Once it is gone, the part will no longer work.
LEDs don't require 20 mA to operate. You can drive an LED with the high side of a gate. Just don't expect to drive logic with it too.
 

zenerz

Joined Dec 22, 2014
13
Could it be the pulse time your giving isn't within spec?
If you look at the datasheet, any rising or falling edge slower than 500-1000 ns WON'T clock the chip!rise.png
 

zenerz

Joined Dec 22, 2014
13
That is not what that timing means. It will respond to an edge at any speed. It is voltage level that counts.
Incorrect. If the rise/fall edge duration is longer than i already stated it WON'T trigger ( Clock ).
Yes, you can do at any frequency you want but the above statement must be met!
 

Thread Starter

JeroenJK

Joined Dec 9, 2015
7
Thanks for all reponses! Very helpful people here.

Did I really say 7943? It's a 7493! To be precise: SN74HC393N.

The diagram: (I think understandable. All unused pins are just not drawn)

thumb_IMG_7555_1024.jpg

But as I understand, one thing that's wrong is that all unused pins (or only inupts?) should be connected to something? And to what, GND?
I put it on 3.3V because I didn't have resistors here at that moment. But I saw somewhere in the datasheet that it doesn't necessarily need that much?
 

zenerz

Joined Dec 22, 2014
13
Thanks for all reponses! Very helpful people here.

Did I really say 7943? It's a 7493! To be precise: SN74HC393N.

The diagram: (I think understandable. All unused pins are just not drawn)

View attachment 98058

But as I understand, one thing that's wrong is that all unused pins (or only inupts?) should be connected to something? And to what, GND?
I put it on 3.3V because I didn't have resistors here at that moment. But I saw somewhere in the datasheet that it doesn't necessarily need that much?
Thanks for all reponses! Very helpful people here.

Did I really say 7943? It's a 7493! To be precise: SN74HC393N.

The diagram: (I think understandable. All unused pins are just not drawn)

View attachment 98058

But as I understand, one thing that's wrong is that all unused pins (or only inupts?) should be connected to something? And to what, GND?
I put it on 3.3V because I didn't have resistors here at that moment. But I saw somewhere in the datasheet that it doesn't necessarily need that much?
Pin 12 ( CLR) must be connected to gnd ( 0v )
 

Thread Starter

JeroenJK

Joined Dec 9, 2015
7
I now got it kind of working, but with an addition.

When I connected pin12 to GND, all leds where blinking heavily and random.

When I connected CLK (13) to GND (with a resistor between) and to 5V with a push on a button it works a little bit. But it counts in the following way:

0
1
2
3
4
5
7 (1 doesn't turn off)
8
10 (2 goes on instead of 1)
12 (3 goes on)
13
14
15

// EDIT: This counting order isn't always the same. It looks like it randomly skips some steps.
 
Last edited:

zenerz

Joined Dec 22, 2014
13
The reason is switch "bounce"

So, when you close the switch as shown in pic below it actually triggers the chip multiple times!!
If you want a de-bounced trigger cct let me know :)

switch.JPG
 

Thread Starter

JeroenJK

Joined Dec 9, 2015
7
To make it more simple for myself I now use a 1hz pulse of the Arduino ;)

By default pin 13 is GND (with a resistor between), but when the signal is high it is 5V (or 3.3V). Is that the correct way? Or is this shortage, and not good?
 

GopherT

Joined Nov 23, 2012
8,009
Thanks for all reponses! Very helpful people here.

Did I really say 7943? It's a 7493! To be precise: SN74HC393N.

The diagram: (I think understandable. All unused pins are just not drawn)

View attachment 98058

But as I understand, one thing that's wrong is that all unused pins (or only inupts?) should be connected to something? And to what, GND?
I put it on 3.3V because I didn't have resistors here at that moment. But I saw somewhere in the datasheet that it doesn't necessarily need that much?

You need to add a resistor in series with each LED. See my first post on this thread.

Just like the LEd on your arduino, the LEDs on your outputs need 330 to 1k resistors in series to protect your output pins (and LEDs). This lack of current limiting may cause the '393 output pins to go into protection mode and appear to blink.
 
Top