Shop OBEX P1 Docs P2 Docs Learn Events
How can I add more outputs? — Parallax Forums

How can I add more outputs?

ArchiverArchiver Posts: 46,084
edited 2003-06-29 15:45 in General Discussion
I recently was introduced to the basic stamp as a possible solution to a
project that I'm working on by a former electronics teacher at my school. To
get to the point, originlly the device only required 9 outputs so I was
fine, but then, I decided that I needed 25 in total. I presented this
problem to the teacher, who recommended the 74154 chip, a multiplexer, 4
input lines, 16 output linues. When I learned more about this chip however,
I found that I would have to continually send data to it in order to keep
the lines the way I wanted them. Is this the best solution, or is there a
different chip that I could, for instance shift out 4 bits to toggle the
value of a line, or even a chip that I could send 5 bits, first 4 to specify
line, next to specify high or low? The main thing I guess I'm interested in
is that it keeps the state of a particular line similarly to how the basic
stamp does. Is there a better way than a 74154?

-Randy

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-06-27 23:34
    If you use the 595 shift register and send it a command, it will hold that
    state until you send another command. The 595 has 8 output lines byt can be
    daisy chained to give you 16-24-36 and so on. If you need help with it let me
    know.

    Sid Weaver
    W4EKQ
    Port Richey, FL


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-27 23:41
    At 05:08 PM 6/27/03 -0500, Randy Becker wrote:
    >I recently was introduced to the basic stamp as a possible solution to a
    >project that I'm working on by a former electronics teacher at my school. To
    >get to the point, originlly the device only required 9 outputs so I was
    >fine, but then, I decided that I needed 25 in total. I presented this
    >problem to the teacher, who recommended the 74154 chip, a multiplexer, 4
    >input lines, 16 output linues. When I learned more about this chip however,
    >I found that I would have to continually send data to it in order to keep
    >the lines the way I wanted them. Is this the best solution, or is there a
    >different chip that I could, for instance shift out 4 bits to toggle the
    >value of a line, or even a chip that I could send 5 bits, first 4 to specify
    >line, next to specify high or low? The main thing I guess I'm interested in
    >is that it keeps the state of a particular line similarly to how the basic
    >stamp does. Is there a better way than a 74154?
    >
    >-Randy

    Hi Randy -

    You might want to look at the Philips PCF8574 which will give you 8 more
    ports per chip. There is also an article in Nuts & Volts magazine which
    addresses its use on the PBASIC Stamp. Sorry, I don't have the article
    number at my fingertips, but someone else may have it, and chime in. The
    articles can be found in the download section of the Parallax web site
    <http://www.parallax.com/> or from the Nuts and Volts web site found here:
    <http://www.nutsvolts.com/>. I2C may be in the title of the article, since
    that's the bus structure that the Philips chip uses.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-27 23:52
    There are two good options here. For slightly higher power demands, the
    74xx595 is great. SPI interface (I think - been a while). Can sink enough
    power to run 8 leds, source is a fair bit weaker (your supposed to sink, not
    source, with shift registers/io expanders anyway). The SPI interface can be
    a bit of a bother compared to I2C but there are lots of stamp examples to
    get you going. You need three pins plus 1 pin per '595 to use this (so 1
    '595 needs 4 pins, 2 needs 5, 4 needs 7 etc)

    The other, which I use exclusively now, is the PCF8574. It can't sink quite
    as much as the '595 but Its great for logic level things. I use it mostly
    for keypads. A nice feature is its interrupt line - if any inputs change it
    signals you through a seperate pin. Sourcing power with this chip is out of
    the question though, only 200uA total IIRC. You can have eight 8574s while
    using only 2 stamp pins.


    Original Message
    From: "Randy Becker" <randy@l...>
    To: "Basic Stamps List" <basicstamps@yahoogroups.com>
    Sent: Friday, June 27, 2003 3:08 PM
    Subject: [noparse][[/noparse]basicstamps] How can I add more outputs?


    > I recently was introduced to the basic stamp as a possible solution to a
    > project that I'm working on by a former electronics teacher at my school.
    To
    > get to the point, originlly the device only required 9 outputs so I was
    > fine, but then, I decided that I needed 25 in total. I presented this
    > problem to the teacher, who recommended the 74154 chip, a multiplexer, 4
    > input lines, 16 output linues. When I learned more about this chip
    however,
    > I found that I would have to continually send data to it in order to keep
    > the lines the way I wanted them. Is this the best solution, or is there a
    > different chip that I could, for instance shift out 4 bits to toggle the
    > value of a line, or even a chip that I could send 5 bits, first 4 to
    specify
    > line, next to specify high or low? The main thing I guess I'm interested
    in
    > is that it keeps the state of a particular line similarly to how the basic
    > stamp does. Is there a better way than a 74154?
    >
    > -Randy
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 01:14
    I've used both extensively and would recommend the 74HC595 just to keep
    things simple. It requires one more line than the PCF8574, but is much
    easier to deal with -- especially with a stock BS2. There are code
    examples on our web site. Our book, StampWorks, shows how to
    daisy-chain multiple '595s for more outputs.

    -- Jon Williams
    -- Parallax


    Original Message
    From: pm [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=PbxLePq-EkcNyyu3JWZRn9bRvcdP9UXwZhiUCJhUOkOBDRd32he3fQsdtiQfH8Pcp2u5UtGa]pmeloy@s...[/url
    Sent: Friday, June 27, 2003 5:53 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] How can I add more outputs?


    There are two good options here. For slightly higher power demands, the
    74xx595 is great. SPI interface (I think - been a while). Can sink
    enough power to run 8 leds, source is a fair bit weaker (your supposed
    to sink, not source, with shift registers/io expanders anyway). The SPI
    interface can be a bit of a bother compared to I2C but there are lots of
    stamp examples to get you going. You need three pins plus 1 pin per '595
    to use this (so 1 '595 needs 4 pins, 2 needs 5, 4 needs 7 etc)

    The other, which I use exclusively now, is the PCF8574. It can't sink
    quite as much as the '595 but Its great for logic level things. I use it
    mostly for keypads. A nice feature is its interrupt line - if any inputs
    change it signals you through a seperate pin. Sourcing power with this
    chip is out of the question though, only 200uA total IIRC. You can have
    eight 8574s while using only 2 stamp pins.


    Original Message
    From: "Randy Becker" <randy@l...>
    To: "Basic Stamps List" <basicstamps@yahoogroups.com>
    Sent: Friday, June 27, 2003 3:08 PM
    Subject: [noparse][[/noparse]basicstamps] How can I add more outputs?


    > I recently was introduced to the basic stamp as a possible solution to

    > a project that I'm working on by a former electronics teacher at my
    > school.
    To
    > get to the point, originlly the device only required 9 outputs so I
    > was fine, but then, I decided that I needed 25 in total. I presented
    > this problem to the teacher, who recommended the 74154 chip, a
    > multiplexer, 4 input lines, 16 output linues. When I learned more
    > about this chip
    however,
    > I found that I would have to continually send data to it in order to
    > keep the lines the way I wanted them. Is this the best solution, or is

    > there a different chip that I could, for instance shift out 4 bits to
    > toggle the value of a line, or even a chip that I could send 5 bits,
    > first 4 to
    specify
    > line, next to specify high or low? The main thing I guess I'm
    > interested
    in
    > is that it keeps the state of a particular line similarly to how the
    > basic stamp does. Is there a better way than a 74154?
    >
    > -Randy
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 02:20

    Original Message
    From: "Jon Williams" <jwilliams@p...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, June 27, 2003 5:14 PM
    Subject: RE: [noparse][[/noparse]basicstamps] How can I add more outputs?


    > I've used both extensively and would recommend the 74HC595 just to keep
    > things simple. It requires one more line than the PCF8574, but is much
    > easier to deal with -- especially with a stock BS2. There are code
    > examples on our web site. Our book, StampWorks, shows how to
    > daisy-chain multiple '595s for more outputs.
    >
    > -- Jon Williams
    > -- Parallax
    >
    >

    Actually, now that you mention it - you dont actually need one extra pin per
    extra chip do you. One way would be to use a '595 as a "chip enable
    selector" and have its outputs enable up to 8 other 595's. You have to send
    two SPI commands out - one to set which 595 to talk to then a second for the
    actual control messages - but that makes for a whopping number of 595s -
    just have to be careful not to enable too many at once and overload your
    stamp [noparse]:D[/noparse]
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 02:42
    No, you can tie all the latch lines together. You'll use SHIFTOUT to
    send all the bits through the devices (one byte per device), the latch
    everything at once. You only need three Stamp pins, I promise. Go to
    our web site and select...

    Downloads >> StampWorks Library >> Experiment 23b

    It will show you what you need to know for 16 outputs -- stepping it up
    to 24 or 32 is no more difficult.

    -- Jon Williams
    -- Parallax


    Original Message
    From: pm [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=co88kXb50jFm24hgdRT0tisD_LrRQMoPRGsp5Wm-qQxyNo95SHtAtbksjmiO-Ap8oDOMaNC4KZ0]pmeloy@s...[/url
    Sent: Friday, June 27, 2003 8:20 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] How can I add more outputs?



    Original Message
    From: "Jon Williams" <jwilliams@p...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, June 27, 2003 5:14 PM
    Subject: RE: [noparse][[/noparse]basicstamps] How can I add more outputs?


    > I've used both extensively and would recommend the 74HC595 just to
    > keep things simple. It requires one more line than the PCF8574, but
    > is much easier to deal with -- especially with a stock BS2. There are

    > code examples on our web site. Our book, StampWorks, shows how to
    > daisy-chain multiple '595s for more outputs.
    >
    > -- Jon Williams
    > -- Parallax
    >
    >

    Actually, now that you mention it - you dont actually need one extra pin
    per extra chip do you. One way would be to use a '595 as a "chip enable
    selector" and have its outputs enable up to 8 other 595's. You have to
    send two SPI commands out - one to set which 595 to talk to then a
    second for the actual control messages - but that makes for a whopping
    number of 595s - just have to be careful not to enable too many at once
    and overload your stamp [noparse]:D[/noparse]



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 03:11
    If you use a board such as the Stamp Stretcher, you get 15 additional
    Inputs/Outputs using a single input pin.
    The board is sold as a kit by www.robotstore.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 03:19
    You could use a 4094 or 74595, and SHIFTIN/SHIFTOUT with
    those. Or, you could use I2C, and the PCF8574.

    --- In basicstamps@yahoogroups.com, "Randy Becker"
    <randy@l...> wrote:
    > I recently was introduced to the basic stamp as a possible
    solution to a
    > project that I'm working on by a former electronics teacher at
    my school. To
    > get to the point, originlly the device only required 9 outputs so I
    was
    > fine, but then, I decided that I needed 25 in total. I presented
    this
    > problem to the teacher, who recommended the 74154 chip, a
    multiplexer, 4
    > input lines, 16 output linues. When I learned more about this
    chip however,
    > I found that I would have to continually send data to it in order to
    keep
    > the lines the way I wanted them. Is this the best solution, or is
    there a
    > different chip that I could, for instance shift out 4 bits to toggle
    the
    > value of a line, or even a chip that I could send 5 bits, first 4 to
    specify
    > line, next to specify high or low? The main thing I guess I'm
    interested in
    > is that it keeps the state of a particular line similarly to how the
    basic
    > stamp does. Is there a better way than a 74154?
    >
    > -Randy
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 14:52
    This is probably overkill for your application, but check out the PAK-IV
    (and the PAK-III) which add I/O pins to the Stamp (or anything really).
    Unlike a shift register, the I/O on the PAK can do powerful things like
    pulse I/O, PWM, etc. just like Stamp I/O. This also gives you a single
    level of concurrency. That is, the PAK can be doing some I/O operation
    at the same time the Stamp is carrying out a different process. So you
    can set the PAK to measure a pulse, for example, and it doesn't stop the
    Stamp from doing what it is doing.

    Details at http://www.al-williams.com/pak3.htm

    Regards,

    Al Williams
    AWC
    * NEW Kit: PC Interfacing made easy: http://www.al-williams.com/gp3.htm




    >
    Original Message
    > From: Randy Becker [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=bcDurMQTSXHlR1LTixa_IsUccstnBSSEL1OhyTqc8q5L-qHaSWIm0l7htwH0s0I1sV6m1a0Dh_A]randy@l...[/url
    > Sent: Friday, June 27, 2003 5:08 PM
    > To: Basic Stamps List
    > Subject: [noparse][[/noparse]basicstamps] How can I add more outputs?
    >
    >
    > I recently was introduced to the basic stamp as a possible
    > solution to a project that I'm working on by a former
    > electronics teacher at my school. To get to the point,
    > originlly the device only required 9 outputs so I was fine,
    > but then, I decided that I needed 25 in total. I presented
    > this problem to the teacher, who recommended the 74154 chip,
    > a multiplexer, 4 input lines, 16 output linues. When I
    > learned more about this chip however, I found that I would
    > have to continually send data to it in order to keep the
    > lines the way I wanted them. Is this the best solution, or is
    > there a different chip that I could, for instance shift out 4
    > bits to toggle the value of a line, or even a chip that I
    > could send 5 bits, first 4 to specify line, next to specify
    > high or low? The main thing I guess I'm interested in is that
    > it keeps the state of a particular line similarly to how the
    > basic stamp does. Is there a better way than a 74154?
    >
    > -Randy
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-28 15:39
    Wow, thanks for all the replies! I think that I'll use two 74HC595s to drive
    this. The device basicly controls 60-watt light bulbs and is part of a much
    larger project. I've already built the output portion which is triggered by
    sinking the input lines. They are conveniently logicly grouped in 9 and 16
    (3x3 and 5x5=9+16). This as well as the (seemingly) fairly easy interface to
    the 595 (reading SW Exp 23b) are why I think that'll work best. Thanks so
    much!

    Oh, for this project I bought and built a BS2 OEM kit (lots of fun!) and I
    need a serial connector on the outside of the box, but the pins are so close
    to the edge of the board that if I use a harddrive ribbon cable to connect
    the board it adds too much space to prevent the port from being attached.
    Does anyone know of a good way to get a cheap 20 pin connection that won't
    take up that little bit of extra space to the left? Also, what about
    mounting the OEM board? the aren't any holes!

    -Randy

    Original Message
    From: "Jon Williams" <jwilliams@p...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, June 27, 2003 8:42 PM
    Subject: RE: [noparse][[/noparse]basicstamps] How can I add more outputs?


    > No, you can tie all the latch lines together. You'll use SHIFTOUT to
    > send all the bits through the devices (one byte per device), the latch
    > everything at once. You only need three Stamp pins, I promise. Go to
    > our web site and select...
    >
    > Downloads >> StampWorks Library >> Experiment 23b
    >
    > It will show you what you need to know for 16 outputs -- stepping it up
    > to 24 or 32 is no more difficult.
    >
    > -- Jon Williams
    > -- Parallax
    >
    >
    >
    Original Message
    > From: pm [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=_QB91OBNg9xT8rvCx0LQVAlawpWLaN47g5ZUIe1ZVX3XggNBblVuntzWvL88YoklIB15L-LUyA]pmeloy@s...[/url
    > Sent: Friday, June 27, 2003 8:20 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] How can I add more outputs?
    >
    >
    >
    >
    Original Message
    > From: "Jon Williams" <jwilliams@p...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Friday, June 27, 2003 5:14 PM
    > Subject: RE: [noparse][[/noparse]basicstamps] How can I add more outputs?
    >
    >
    > > I've used both extensively and would recommend the 74HC595 just to
    > > keep things simple. It requires one more line than the PCF8574, but
    > > is much easier to deal with -- especially with a stock BS2. There are
    >
    > > code examples on our web site. Our book, StampWorks, shows how to
    > > daisy-chain multiple '595s for more outputs.
    > >
    > > -- Jon Williams
    > > -- Parallax
    > >
    > >
    >
    > Actually, now that you mention it - you dont actually need one extra pin
    > per extra chip do you. One way would be to use a '595 as a "chip enable
    > selector" and have its outputs enable up to 8 other 595's. You have to
    > send two SPI commands out - one to set which 595 to talk to then a
    > second for the actual control messages - but that makes for a whopping
    > number of 595s - just have to be careful not to enable too many at once
    > and overload your stamp [noparse]:D[/noparse]
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p....
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-29 15:45
    --- In basicstamps@yahoogroups.com, "Randy Becker" <randy@l...>
    wrote:
    > I recently was introduced to the basic stamp as a possible
    solution to a
    > project that I'm working on by a former electronics teacher at my
    school. To
    > get to the point, originlly the device only required 9 outputs so
    I was
    > fine, but then, I decided that I needed 25 in total. I presented
    this
    > problem to the teacher, who recommended the 74154 chip, a
    multiplexer, 4
    > input lines, 16 output linues. When I learned more about this chip
    however,

    While the 74154 will give you 16 outputs, and they will maintain
    their state (reflecting the 4 BS2 outputs), the real problem is that
    only *1* output can be active at a time. To get 8 or 16 or more
    outputs that maintain their state, you will need a chip such as the
    one suggested by others (74LS595). Just thought you should know why
    the 74154 wouldn't be a good choice.
Sign In or Register to comment.