I/O expansion over I2C using PCF8574
Rayman
Posts: 14,523
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
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
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
Thanks for the link on the hot-swappable I2C level shifter.
I've got code for it in the i2cObject 1.3 in the OBEX
(Jon Williams did a Nuts&Volts article on it..!)
J
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...
J