Connect with us

74hc238 binary decoder info

Discussion in 'General Electronics Discussion' started by Dustin Yoder, Sep 2, 2014.

Scroll to continue with content
  1. Dustin Yoder

    Dustin Yoder

    6
    0
    Jul 16, 2014
    I bought several 74hc238 3x8 binary decoder chips to try to allow my raspberry pi gpio pins to potentially control many more relays. first step is to test my binary decoder chip so I put it on a bread board with the pi's 3v out connected to vcc and pi's gnd to gnd. Then i tie g2a and g2b both to ground. Then i hooked up 4 leds to the chip outputs 0-3. I put a 200ohm resistor between ground and leds. So i assume no output till i give the enable pin 3v, but the leds are flickering. They light more or less if i touch the chip or even the breadboard. I can tell that the led for 0 lihts brighter when i put 3v on the enable pin but it stays bright after i remove the 3v from enable. Is my chip screwed up or do i need a resistor on vcc or something? Thanks for the help.

    Chip datasheet here. http://www.sparkfun.com/datasheets/Components/General/COM-09577-m74hc238.pdf
     
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    Have you connected ALL inputs somewhere? There are three enable inputs (pins 4, 5 and 6) and three select inputs (pins 1, 2 and 3) and they all have to be connected to something.

    Pins 4 and 5 must be low, and pin 6 must be high, to enable the IC. Pins 1 and 2 must be driven by your Raspberry Pi, and pin 3 must be tied low if you're not also driving it.

    The 74HC238 will only drive one output active at a time. So although you can control seven relays independently, you can't enable more than one simultaneously.
     
  3. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,418
    2,788
    Jan 21, 2010
    A possibly better option is the 74HC595 which will allow you to independently control 8 outputs per chip and you can cascade them. And all you require is 3 outputs and some bitbanging.

    I'm sure that if you Google"raspberry pi 74HC595" you will find someone who has been here before.
     
    KrisBlueNZ likes this.
  4. Dustin Yoder

    Dustin Yoder

    6
    0
    Jul 16, 2014
    So I was under the impression that disconnecting the 3v from the inputs was the same as having a gpio pin connected but turned off. Is this is not the case?
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    "... connected but turned off..." doesn't mean anything. Also the input and output pins on the HC238 are not GPIO. Each one is defined as either an input or an output by the design of the device. Inputs on HC devices have a very high impedance and will float to random states if they are not connected to something with a defined state.
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,418
    2,788
    Jan 21, 2010
    As Kris has said. For CMOS (you're using 74HCxxx which is high speed CMOS) the imputs need to be pulled to one logic state or the other.

    TTL (74xxx) or LSTTL (74LSxxx) have inputs that float high, so a disconnected input is like one tied to the positive supply rail.
     
  7. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    You're not supposed to rely on that. Though designers usually do :)
     
  8. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,418
    2,788
    Jan 21, 2010
    True, I was going to add that it's bad practice as it has a very low noise margin. But since we're talking about CMOS I decided to pass on it.
     
  9. Dustin Yoder

    Dustin Yoder

    6
    0
    Jul 16, 2014
    Great! It works now. I learned about pulling low. Thanks.
     
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,418
    2,788
    Jan 21, 2010
    Excellent, congratulations.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-