 |
If you need more input/output pins than the 32 that the Propeller gives
you, you can use the existing I2C bus (Pins# 28 & 29) to interface with I/O
expansion chips.
 |
This gives you more pins without using up ANY that weren't already
in use. |
 |
Also, by using an I2C "Level Shifter" you can use the I/O pins with
other voltages, e.g., 5V. |
|
 |
I/O Expanders:
 |
The
PCF8574 is a simple 8 I/O port device (comes in 16 Pin DIP). This
chip has been around a long time...
 |
I'd recommend using the PCA9554 (below) instead. |
 |
I've made a minimal I2C driver (based in Mike Green's i2c driver in
Object Exchange). Here's a screenshot:

|
 |
|
 |
Vdd from 2.5 to 6 VDC, 100kHz I2C, can sink 25 mA per pin but
only 100 mA total, source 0.1 mA per pin, 5 V tolerant I/O. Two
pins may be tied together to sink 50-mA. |
|
 |
The
PCA9554 is basically an improved version of the PCF8574 and has the
exact same pinout. But, the control commands are a bit
different...
 |
It offers individual pin I/O directions and polarities.
|
 |
|
|
 |
The MAX6956
is a 20/28 I/O port device (comes in 28 Pin DIP) and has a driver in the
Object Exchange. |
 |
The
MCP23016 is a 16 port I/O expander (also comes in 28 PIN DIP) and has a
driver in Object Exchange. |
 |
|
|
 |
I2C Bus Expanders / Level Shifters
For level shifting to 5V, I haven't found anything in a DIP package.
Best is an 8-pin SO8 package.
 |
I've used the
PCA9512A (gives hot-swap ability) and the
PCA9509 (easy pin arrangement)
|
 |
Here's some pictures of how I put 3 PCF8574 (running at 5 VDC) in a
separate box from the Prop, with a 2-ft cable carrying the I2C signals
(note that a 6-ft cable didn't work, would need to add an i2c extender
in the prop box to make that work).
 |
 
|
|
|