Shop OBEX P1 Docs P2 Docs Learn Events
Need more input pins — Parallax Forums

Need more input pins

ErlendErlend Posts: 612
edited 2013-05-12 00:08 in Propeller 1
My project keeps expanding, and now there are no more spare i/o pins. I remember having seen a digital input chip with spi i/f on the parallax site, but now I just cannot find it. (I know, it's like asking my wife where my socks are - right in front of me)

-like Firefox says "Well, this is embarrassing",

Erlend

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-04-29 07:11
    74HC595 for 8 outputs and 74HC165 for 8 inputs, both cascadable for more I/O
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-04-29 07:38
    If you're comfortable with I2C the MCP23017 is a nice chip and easy to use. The added bonus is that it's using the same pins as the EEPROM so you're not giving up other IO pins to use it.
  • kwinnkwinn Posts: 8,697
    edited 2013-04-29 10:18
    Not only are the '595 & '165 cascadable, they can share the control lines in many cases so even fewer pins are required.
  • TCTC Posts: 1,019
    edited 2013-04-29 13:15
    Just an idea, you could check out Maxim's "MAX6957" (SPI version) "MAX6956" (I2C version). for the DIP version, it has 20 inputs/outputs, each one is configurable as constant current LED driver, output, input with pull ups, and input without.
  • ErlendErlend Posts: 612
    edited 2013-04-30 00:13
    @JonnyMac
    I am not too familiar with I2C, but this would be an opportunity to fix that. The fun is in learning. I'm not into PASM, though, I spend most of my Propeller time on improving my Spin skills. Will have to lean on Obex. Cannot find MCP23017 in the Parallax store, though, and not at Sparkfun. Any idea where?

    @Mike
    8 inputs is just enough, but I may tie 2-3 together. Any idea where I can find some more on the data communication? The datasheet is quite rudimentary on that.

    @TC
    MAX6957 looks very flexible.


    I guess this boils down to availability. I prefer to place an order of more than one chip, and I like to support the Parallax store when I can.

    Erlend
  • kwinnkwinn Posts: 8,697
    edited 2013-04-30 19:08
    I could not find a data sheet for the '165 that included a timing diagram so I am attaching the '597 data sheet which performs the same function. The timing diagram it includes should be of help with the '165. Personally I prefer the '595 since having all but one of the input pins on the same side makes laying out a board simpler.

    One of the nice things about the 595/597(and 165) is that they can add as many input and output pins as you want using only 3 prop pins in total.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2013-04-30 19:15
    One thing I don't like about the 595 is that the total output is limited to 70ma. If you want to be in spec you can't really run 8 leds properly. I use this for driving leds, you only have to use one resistor to set the current for all outputs. http://www.ti.com/product/tlc5916 Is similar to the 595 in use.
  • kwinnkwinn Posts: 8,697
    edited 2013-04-30 20:09
    Nice one. Thanks for posting that Erik.
  • jmgjmg Posts: 15,173
    edited 2013-04-30 21:13
    Erlend wrote: »
    My project keeps expanding, and now there are no more spare i/o pins. I remember having seen a digital input chip with spi i/f on the parallax site

    If the needs are simple, then octal logic shifters are cheap, if not very bright.

    If you need more than ~ 2-3 of these, you could look at low cost 'vanilla' uC like AT89LP52 (~66c/100) ie < 2c / io pin at 36 ios.
  • ErlendErlend Posts: 612
    edited 2013-04-30 23:23
    I've read up on the various options. Think I'll go for an IC2 interfaced one. There should be no reason for not coding the I2C protocol in Spin, it doesn't need to be lightening fast, and really, I2C isn't that more complex than reading the shift registers - that even need 3-4 pins from prop. Not the least, the spin-off (haha) will be that I learn to speak IC2 in Spin. What remains, then, is to get my hands on one or two of those chips.

    Erlend
  • Mag748Mag748 Posts: 266
    edited 2013-05-01 07:29
    In case you still need it, attached is a datasheet for the 165 that has a timing diagram on page 7.

    Thanks,
    Marcus
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-05-02 00:30
    Erlend wrote: »
    I've read up on the various options. Think I'll go for an IC2 interfaced one. There should be no reason for not coding the I2C protocol in Spin, it doesn't need to be lightening fast, and really, I2C isn't that more complex than reading the shift registers - that even need 3-4 pins from prop. Not the least, the spin-off (haha) will be that I learn to speak IC2 in Spin. What remains, then, is to get my hands on one or two of those chips.

    Erlend
    Yes, good choice, and now you can reuse P28 and P29 as the I2C bus with the bonus that additional ports will not require any extra pins. Basic I2C mode consumes very little software resources too. The PCF8574 and variants usually have a weak pullup on the I/O so you can even connect switches directly. Although I haven't used these chips for a very very long time it is by chance that a customer wanted a dumb thumb-wheel switch interface to his equipment and since I had designed a spare 4-pin header ( 2 I/O, GND, +5V) on the pcb originally I was then able to interface the thumbwheel easily using a PCF8574.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-05-02 04:03
    There should be no reason for not coding the I2C protocol in Spin...

    For simple IO, I agree. I've attached my MCP23017 object which uses my basic I2C object. Both objects are Spin.

    Mouser is my favorite parts source, and they care all packaging variations of the chip.
  • doggiedocdoggiedoc Posts: 2,243
    edited 2013-05-02 04:15
    OBC carries the MCP23017 at propellerpowered.com at a very reasonable price and you'd be supporting on of our forum members.

    http://propellerpowered.us/index.php?route=product/product&path=25_64_68&product_id=99
  • KaosKiddKaosKidd Posts: 296
    edited 2013-05-02 13:48
    Well, all of this is great info: I just ordered samples of Microchip's MCP23017 and Maxim's MAX6956.
    This and Jon's I2C driver should answer my one of my little "delema's" on my current project...
    Thanks all for posting!

    Fred
  • ErlendErlend Posts: 612
    edited 2013-05-12 00:08
    Again- this forum is perfect. MCP23017 from propellerpowered and Spin from JonnyMac. Off I go.

    Erlend
Sign In or Register to comment.