Shop OBEX P1 Docs P2 Docs Learn Events
Cascading 74HC595s and 74HC165s — Parallax Forums

Cascading 74HC595s and 74HC165s

Bill ChennaultBill Chennault Posts: 1,198
edited 2006-10-04 19:29 in BASIC Stamp
All--

I am excited about expanding the Stamp's I/O capabilities using the 74HC595 (for output) and the 74HC195 (for input). Remembering that I am new to this microcontroller and IC world, would you please answer a few questions? (And, for your reference, I have the BOE with a BS2PX and a PDB with a BS2P40.)

1. How many 74HC595 devices may I cascade before I have to worry about power considerations? And, if necessary, how do I supply the additional power?

2. Is there an addressing issue involved at some point when cascading 74HC595 devices?

3. How many 74HC195 devices may I cascade before I have to worry about power considerations? And, if necessary, how do I supply the additional power?

4. Is there an addressing issue involved at some point when cascading 74HC195 devices?

The Stampworks book says that ". . . the BASIC Stamp is able to control dozens of 74HC595 outputs with the same three I/O pins." (Page 133.) The Stampworks book says something similar concerning cascading the 74HC195 for additional inputs. (Page 139.)

For me, this is an important question. It is the question that led me to the microcontroller approach and this forum in the first place. I realize the questions above are doubtless simple, but I also do not know the answers.

Thanks!

--Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.

Comments

  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2006-10-04 16:04
    All--

    I should have also asked if the processing time to input or output a bit is directly related to the number of 74HC595 and/or 74HC195 devices attached to the microcontroller.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-04 16:10
    1) The 74HC595 devices don't take enough power by themselves to worry about. The main issue is the devices they're driving. If you're driving LEDs, they each take 10-20ma typically. Each 74HC595 and its LEDs would take 80-160ma if they're all on. Five such units would draw 800ma which would be ok for a BOE or PDB, but you couldn't really add anything else.
    2) No. You just send 8 more bits for each additional device. The Stamps are limited in how much memory they have to figure out what to send, but you could just be sending out data from tables in eeprom and the limited variable space wouldn't matter that much.
    3) The 74HC195 devices also don't take much power and they don't have to drive anything else.
    4) No. You just have to receive 8 more bits for each additional device. Again, the Stamp is limited in variable storage (26 bytes). Some Stamps have additional RAM where you can dump the data with the GET/PUT statements.

    The time required to send/receive the data is proportional to the number of devices cascaded, but you're really limited mostly by the time to process the data in the Stamp. If you're lighting up a display and each bit is a pixel, you're spending most of your time outputting existing data to the display and there's very little manipulation involved. If you have to do any significant amount of computation for each bit, it's going to be slow as the number of bits increase.

    Post Edited (Mike Green) : 10/4/2006 4:15:58 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-04 16:21
    Another caveat: The 74HC595 is limited to a total supply current of 70ma. If you're driving LEDs and they're all on, they can't draw more than about 8ma each. Any one output pin can supply over 20ma, but only 3 of those can be on at a time. There are specialized LED drivers that can handle higher total currents.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2006-10-04 18:22
    Mike--

    Thanks!

    I will be driving relays to control motors. Therefore, it looks like I need some additional circuitry between the 74HC595 and the relay. I will thoroughly familiarize myself with '595 and '195 operation, including cascading, first. But, can you steer me in the right direction as concerns circuitry to drive the relay coils? They will be low power devices. Perhaps some opto-isolation circuitry might be appropriate?

    I will probably use these relays from Elexol. They are 12v relays, but I do not see anything that tells me how much current they draw. Maybe Elexol will tell me. I already have one of these boards, but have done nothing with it, yet.

    As far as compute-time available is concerned, my plan is still to use the microcontroller as a dedicated I/O machine and communicate either with an on-board tablet PC or, ideally, to a desktop or network of desktops via wireless link.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-04 19:09
    Bill,
    ·
    ·· Driving Relays brings in a whole new set of things to worry about.· First of all you should never drive the Relays directly from any logic output.· As inductive devices they really should be driven from a transistor or transistorized driver such as the ULN2803.· So each 74HC595 will have a ULN2803 on its outputs as well.· There are examples of driving relays in this fashion, but the ULN2803 has the internal clamping diodes you would require for each relay.· The other thing to worry about is the dedicated 12V supply for the relays.· You want to avoid drawing from the same power supply as you’re using for your logic and controller since the relays all turning on/off will introduce noise into the supply.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2006-10-04 19:29
    Chris--

    Thanks!

    I just read "Silicon Steroids" and the·ULN2803 looks simple to use. (And, Parallax sells it! Imagine that!)

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
Sign In or Register to comment.