7943 (SN74HC393N) not working how I expect it to

Discussion in 'General Electronics Chat' started by JeroenJK, Jan 6, 2016.

  1. JeroenJK

    Thread Starter New Member

    Dec 9, 2015
    7
    0
    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!
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    Welcome to AAC!
    Please post a schematic (hand drawn is OK) of your circuit and we will be in a better position to help.
     
  3. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    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...
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    @dl324 Fast mouse!
    Give him a hand if you can. Thanx
     
  5. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    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, ...
    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...

    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.
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,007
    3,232
    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.
     
    cmartinez likes this.
  7. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,035
    3,803
    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.
     
  8. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    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...
     
  9. hp1729

    Well-Known Member

    Nov 23, 2015
    1,951
    219
    What is the Clear input doing?
     
  10. hp1729

    Well-Known Member

    Nov 23, 2015
    1,951
    219
    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.
     
  11. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,035
    3,803
    Could you post a picture of your "7943-IC" I think there is some confusion on the part name. The part should be called a 74HC393. I think you bought a really old set of ICs and 7943 is the date code. As in 1979 week 43.
     
  12. zenerz

    New Member

    Dec 22, 2014
    13
    1
    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
     
  13. hp1729

    Well-Known Member

    Nov 23, 2015
    1,951
    219
    That is not what that timing means. It will respond to an edge at any speed. It is voltage level that counts.
     
  14. zenerz

    New Member

    Dec 22, 2014
    13
    1
    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!
     
  15. JeroenJK

    Thread Starter New Member

    Dec 9, 2015
    7
    0
    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?
     
  16. zenerz

    New Member

    Dec 22, 2014
    13
    1
    Pin 12 ( CLR) must be connected to gnd ( 0v )
     
  17. JeroenJK

    Thread Starter New Member

    Dec 9, 2015
    7
    0
    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: Jan 7, 2016
  18. zenerz

    New Member

    Dec 22, 2014
    13
    1
    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
     
  19. JeroenJK

    Thread Starter New Member

    Dec 9, 2015
    7
    0
    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?
     
  20. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,035
    3,803

    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.
     
Loading...