Shop OBEX P1 Docs P2 Docs Learn Events
74595 Shift Register Question — Parallax Forums

74595 Shift Register Question

GorillaGorilla Posts: 16
edited 2012-05-08 18:00 in BASIC Stamp
I am trying to get the stamp works 23b expanding outputs using 74hc595 shift register to work. I hooked everything up doubled checked everything but it doesn't work, the LED just stays lit no matter what changes I make to the example code. I am using the 10k resistor and have all the connections correct. Why isn't it working?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-07 06:28
    The StampWorks exercise works as described. Even though you've checked your wiring, there's probably something you've overlooked. Get someone else to check your wiring. You can make up a schematic based on the actual wiring on your board and post that. You can take a closeup picture of your wiring and post it. Also, post your program as an attachment to a message (not cut and paste please). Make sure this is the program you're running, not what it's supposed to be.
  • GorillaGorilla Posts: 16
    edited 2012-05-08 16:18
    Mike I had wired everything correctly but my external breadboard was shorting that is why it wasn't working it was an old board. When I hooked the 595's on the stamp breadboard it worked flawlessly. Now I want to drive common anode displays with the 595's by connecting the cathodes of the 7 segment displays to the 595's QA-QH pins. Can I use a 2N3904 NPN transistor with a 330 ohm resistor connected to the base? What do I connect the collector and emitter to if I do it this way? Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-08 18:00
    The emitter goes to ground. The collector goes to a resistor and the other end of the resistor goes to the cathode. The resistor value depends on the brightness of the LED you want, the type of LED (Vf - forward voltage), and on the maximum current the LEDs will tolerate ... often 10 to 20mA (see this). You're probably powering them from 5V. You subtract 1.2V for the two driver transistors (0.6V saturation voltage each), then Vf to get the voltage drop in the resistor. You use Ohm's Law: Resistor Voltage = Maximum current * Resistor Value, then pick the next highest value available.

    You'll need another driver for the common anodes. You'd use a 2N3906 PNP transistor with another 330 Ohm base resistor connected to a Stamp I/O pin or another 74HC595, the emitter connected to Vdd (+5V) and the collector connected to the common anode. The PNP transistor would turn on when the Stamp output or 74HC595 output is low.

    You should probably connect the /OE pins of all the 595s to another Stamp I/O pin with a 10K pullup to +5V so the 595 outputs and the transistors will remain off until you're able to initialize everything. You could even add 10K pulldowns (to ground) for the NPN transistor bases and pullups (to Vdd) for the PNP transistor bases to ensure that all remains off until deliberately turned on.
Sign In or Register to comment.