Shop OBEX P1 Docs P2 Docs Learn Events
I/O expansion over I2C using PCF8574 — Parallax Forums

I/O expansion over I2C using PCF8574

RaymanRayman Posts: 14,162
edited 2007-11-05 12:05 in Propeller 1
I'm using a few PCF8574's to add 24 extra I/O pins using the existing I2C bus on Pins 28&29.

Here's a·minimal I2C driver for it (based on Mike Green's Object Exchange file) and a demo program (and a screenshot).

I've also put a few notes on how I got the PCF8574's working remotely at 5 VDC with an I2C hot-swappable level shifter here:

http://www.rayslogic.com/propeller/Programming/i2c/i2c.htm

Comments

  • MarkSMarkS Posts: 342
    edited 2007-11-02 03:16
    That is truly awesome!
  • OzStampOzStamp Posts: 377
    edited 2007-11-02 04:17
    Cool guy's

    I2C is a neat way to expand...
    Just be aware that when using the 8574 devices as output drivers .. they can't source much at all..
    they can only sink enough to drive leds ...small loads
    And another major issue with them is that if you drive something with them and your CPU freezes
    the output will stay on .. if it was "commanded on" previously.. ( there is no reset pin on these devices..)
    So if you have an output that is suppose to be safe .. if power drops .. dips...glitches ... be aware.
    Another good option is to use a SX28 dipper and implement the I2C protocol with the SXB compiler
    There are 20 I/O lines ( 2·off 8 bit ports and 4 extra >>2 for I2C and 2 spare..)

    cheers
    Ron Melbourne Australia

    Post Edited (OzStamp) : 11/2/2007 9:37:26 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-02 04:22
    The PCA9554 is a little newer and a bit nicer to use. It has real source drivers too.

    Thanks for the link on the hot-swappable I2C level shifter.
  • JavalinJavalin Posts: 892
    edited 2007-11-02 09:08
    the MCP32016 is a 16 pin I/O expander requiring just a cap and resistor to work.

    I've got code for it in the i2cObject 1.3 in the OBEX

    (Jon Williams did a Nuts&Volts article on it..!)

    J
  • RaymanRayman Posts: 14,162
    edited 2007-11-02 12:36
    Javalin: I think you mean MCP23016, right? This does look like a nice chip. Easily found in DIP package and runs at 3.3 V or 5 V. But, I wanted to start with something simpler...

    Mike: The PCA9554 does look all around better that PCF8574 and is pin compatible. But, I didn't see it anywhere available in the DIP package.

    I like to prototype with narrow DIP packages and Vector proto board...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-02 14:34
    I think I got my PCA9554 in PDIP from DigiKey. I got them from one of the folks I usually deal with: Jameco, DigiKey, Mouser.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-02 16:10
    Rayman, I think TI numbers that version as pca9554pw. So http://www.mouser.com/search/refine.aspx?Ntt=595-PCA9554PW
  • JavalinJavalin Posts: 892
    edited 2007-11-05 12:05
    Sorry yes its a MCP23016. Couldn't be easier. Look at the code in the i2cObject......

    J
Sign In or Register to comment.