Shop OBEX P1 Docs P2 Docs Learn Events
Wiring the 74hc595 correctly. — Parallax Forums

Wiring the 74hc595 correctly.

MSteinMStein Posts: 9
edited 2011-02-24 08:11 in General Discussion
Greetings, I've been trying to get the 74hc595 to work for me.

I see in other discussions that three wires are used from the BS2, Here I'm only using two, and that's probably why it's not working. I jumped pins 12 and 13 on the 595, and these pins are separated in examples. I need the proper wiring to get this display to work.I use pins 9 and 10 for shiftout command. Should I use the third pin to send a pulse to initiate the download?

Thank you.

' {$STAMP BS2}
' {$PBASIC 2.5}

PAUSE 1000


    tc VAR Byte



Main:


   DO
     HIGH 14       'led blinker to show the stamp is alive
     tc = 8           'random value for tc to test led display 
     PAUSE 500
     GOSUB lightshow
     DEBUG ? tc
     LOW 14
     PAUSE 500
  LOOP


END


Lightshow:
 IF tc = 0  THEN  SHIFTOUT 9, 10, 0, [%00000001]
 IF tc = 1  THEN  SHIFTOUT 9, 10, 0, [%00000011]
 IF tc = 2  THEN  SHIFTOUT 9, 10, 0, [%00000111]
 IF tc = 3  THEN  SHIFTOUT 9, 10, 0, [%00001111]
 IF tc = 4  THEN  SHIFTOUT 9, 10, 0, [%00011111]
 IF tc = 5  THEN  SHIFTOUT 9, 10, 0, [%00111111]
 IF tc = 6  THEN  SHIFTOUT 9, 10, 0, [%01111111]
 IF tc = 7  THEN  SHIFTOUT 9, 10, 0, [%01111111]
 IF tc = 8  THEN  SHIFTOUT 9, 10, 0, [%11111111]
RETURN

Comments

  • LeonLeon Posts: 7,620
    edited 2011-02-20 08:03
    See the 74HC595 data sheet for connection details.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-20 08:10
    Also download and look at the StampWorks Manual, Experiment #23 which shows how to use the 74HC595 with a Stamp.

    Use the Downloads button on Parallax's main webpage and look under Educational Tutorials & Translations
  • tonyp12tonyp12 Posts: 1,951
    edited 2011-02-20 08:13
    Using only using two pins, maybe it can be done becuase is says.
    Quote:
    Both the shift register clock (SRCLK) and storage
    register clock (RCLK) are positive-edge triggered.
    If both clocks are connected together, the shift
    register always is one clock pulse ahead of the
    storage register.


    But if you are using 3 pins maybe other IC's could also work
    for what you are doing, like a 3-to-8 decoder?
  • MSteinMStein Posts: 9
    edited 2011-02-20 09:37
    OK Mike, I found it, and will be poring over it.

    Thanks for the help
  • MSteinMStein Posts: 9
    edited 2011-02-20 10:04
    And it's working fine.... :)

    Thank you very much.

    I needed a 10k resistor on the latch.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-02-20 10:25
    MStein
    '
    Yes you do.
    '
    Its a pull-down resistor on the LATCH pin(12) of the 74HC595.
    '
    With out it you can get errors at the outputs of the 74HC595.These errors will appear strange and at random because the LATCH pin was left floating instead of pulled logic low by the pull-down resistor.
  • MSteinMStein Posts: 9
    edited 2011-02-22 07:33
    I wired two of them together, and get a flicker when I change the LEDs around,
    the manual says no pulldowns on the second 595, should I pull it down too...?
    And should I put decoupling caps anywhere..? Maybe around the BS2...?
  • LeonLeon Posts: 7,620
    edited 2011-02-22 07:39
    The supply pins on the 595 chips should be decoupled, of course.
  • MSteinMStein Posts: 9
    edited 2011-02-24 07:57
    By supply pins, you mean Vdd... ?

    I am a newbie... :)
  • LeonLeon Posts: 7,620
    edited 2011-02-24 08:11
    Vdd and Vss. You could also latch the outputs whilst you are updating, to avoid flicker.
Sign In or Register to comment.