Shop OBEX P1 Docs P2 Docs Learn Events
Pin multiplier questions... — Parallax Forums

Pin multiplier questions...

HomeSchoolDadHomeSchoolDad Posts: 32
edited 2005-10-12 14:28 in BASIC Stamp
Greetings all!

In the post below Jon (great resource that guy!) gave a circuit diagram of using a 74HC595 and a 75HC165 to create additional I/O when you run out of pins. That diagram uses 3 stamp pins (I use a BS2pe) to create the additional I/O by combining the clock signals.

http://forums.parallax.com/showthread.php?p=548988

Here is what I would like to know:
  • Do I understand that this gives me 16 pins organized as 8 ins and 8 outs so that I have (for instance) 8 buttons and 8 LEDs?
  • Could I use multiple chips to create more inputs/outputs from the same 3 pins?
  • Can I tie other clocks (such as serial flash memory) to this clock to reduce my overall pin usage?
  • Is this within reason as fast as direct pin use and worthwhile to do rather than changing the design to use the BS2p40?
I know that is a lot of questions for one post, but they all relate to the same mux diagram and I thought it better to contain them in a single thread.

Thanks in advance for your responses!

Jeff

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-10-11 17:53
    [*]Do I understand that this gives me 16 pins organized as 8 ins and 8 outs so that I have (for instance) 8 buttons and 8 LEDs?[*]The outputs of either chip cna turn an LED on or off, but they have no "intelligence".· That is to say, the outputs will go high or low, but they can not sense a change of state on the output pin.· For this you need an MCP23016.
    [*]Could I use multiple chips to create more inputs/outputs from the same 3 pins?[*]You can daisy-chain up to 8 chips, giveing you 64 outputs.
    [*]Can I tie other clocks (such as serial flash memory) to this clock to reduce my overall pin usage?[*]Probably.
    [*]Is this within reason as fast as direct pin use and worthwhile to do rather than changing the design to use the BS2p40?[*]Absolutely, as far as simple outputs go.· Remember, the outputs are "dumb terminals".· They can not sense anything

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-11 18:57
    1. Yes
    2. Yes; you should be able to daisy-chain devices (I've not done it with that circuit, but nothing jumps out at me as being a problem)
    3. Yes, so long as the device is being controlled by the Stamp
    4. Not as fast as with a BS2p40 (since you have serial/parallel conversion), but still a cheap way to add simple I/O

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • HomeSchoolDadHomeSchoolDad Posts: 32
    edited 2005-10-12 13:31
    Thanks for the reply guys.

    This sounds like a winner, but I·can't seem to wrap my head around how exactly a daisy chain with these devices would be accomplished.

    Also, the MCP23016 seems like a good idea just because it looks like it would give me the option of In, Out, or I/O an any extended pin, but it is I2C so I suspect much slower.· Also, I am already using the 0/1 pin·set for the bluetooth app·header and the 8/9 pin set for an I2C LCD - can I share one of these with that chip?· Can I chain that chip·for more pins?· Is it much slower/costlier than the 74HC595 and 75HC165 option?

    As usual, you guys are the greatest - thanks again for the replies.

    ··· Jeff
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-12 13:36
    Since you've got a BS2pe, go with the MCP23016 -- much cleaner and easier than the shift-register approach, and it will be faster as well (check the kBits-per-second rates on I2COUT versus SHIFTOUT).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 10/12/2005 1:39:24 PM GMT
  • NewzedNewzed Posts: 2,503
    edited 2005-10-12 13:36
    You can use the MCP23016 on the LCD I2C bus as long as the addresses are different.· You could run up six MCPs on the LCD bus as long as they all had different addresses, which are set on A1, A2 and A3.· Last time I looked the MCP was $1.86.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • HomeSchoolDadHomeSchoolDad Posts: 32
    edited 2005-10-12 13:42
    WOW YOU GUYS ARE FAST!

    I barely had time to send another email before I got your replies!

    I am running a BS2pe so it has the I2C code in it and the price of the MCPs are wonderful so it looks like my decision is made!· You guys ROCK.

    THANK YOU.

    ··· Jeff
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-10-12 13:56
    Jeff -

    Since your level of electonics "expertise" is unknown to me, let me approach your question from a logical or physical point of view, as opposed to an electrical/electronics point of view. The answer is the same, only the specific words used will really differ.

    When you're dealing with shift registers or latches of the type being discussed, the primary feature which makes them so desirable for pin expansion is the fact that in addition to any other qualities they may have, they are parallel to serial or serial to parallel (depending on how you choose to view it) devices. What this means is that 8 adjacent pins (PARALLEL) on the chip, which can operate independently, can be set or queried by inspection or manipulating the continuous string (8 bits or more) of bits (SERIAL) which can be sent or received from these devices. The number of parallel pins, and thus the number of bits in the serial steam representing those pins, is device dependent.

    Shift registers and latches generally come in multiples of 8 bits (8, 16, 32, 64) and there is always a direct correlation and 1-to-1 relationship between the number of adjacent I/O pins (PARALLEL) and the number of bits in the resultant bit string (SERIAL). 8 I/O pins yields 8 bits of serial data, 16 I/O pins yields 16 bits of serial data, etc.

    Many if not most of these chips are designed in such a way that they can be cascaded. The (additional) input from one stage, can come from the output of a prior stage. Thus, if so cascaded, one can extract 16 bits of serial data from a cascaded pair of 2 x 8 parallel devices. This continues in effect, upwards; 16 = 2 x 8, 24 = 3 x 8, 32 = 4 x 8, etc.

    I hope that gives you a better feel for what goes on with "daisy chaining" or cascading shift registers. BTW - My hat is off to all who home-school, and have that sort of patience!

    Regards,

    Bruce Bates
  • SPENCESPENCE Posts: 204
    edited 2005-10-12 13:58
    Where can you get the mcp23016. I could not even get samples from microchip,

    73
    spence
    k4kep
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-12 14:04
    Mouser has them. So does Digi-Key.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • kb2hapkb2hap Posts: 218
    edited 2005-10-12 14:05
    www.findchips.com

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • NewzedNewzed Posts: 2,503
    edited 2005-10-12 14:28
    I think I have an MCP23016 piggyback.· You can read about it on my site.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
Sign In or Register to comment.