Now that I can successfully control a PCF8574, does anyone know how to control the 16 I/O MCP23017 chip? I have a project that would need either 12 PCF8574, or just six MCP23017 ICs. But this chip allows you to operate it in a two bank mode, so it is not as straight forward as the PCF8574 is.
I would like GPA ports to be outputs, and the GPB ports to be inputs. I did a search on this and it seems to take a form of;
i2cslave %01001100, i2cfast, i2cbyte
writei2c $10,($00) 'makes all GPB pins outputs
Pause 100
writei2c $00,($255) 'makes all GPA pins inputs
Pause 100
writei2c $06,($255) 'makes all GPA pins have pullups
But this does not produce any inputs or outputs for me. In the data sheet there is a reference to “IOCON – I/O EXPANDER CONFIGURATION REGISTER (ADDR 0x05)”. Do I need to deal with this to set up how I communicate to the chip?
Edited by - erdc on 20/02/2007 18:41:06
Edited by - erdc on 20/02/2007 18:42:05
I would like GPA ports to be outputs, and the GPB ports to be inputs. I did a search on this and it seems to take a form of;
i2cslave %01001100, i2cfast, i2cbyte
writei2c $10,($00) 'makes all GPB pins outputs
Pause 100
writei2c $00,($255) 'makes all GPA pins inputs
Pause 100
writei2c $06,($255) 'makes all GPA pins have pullups
But this does not produce any inputs or outputs for me. In the data sheet there is a reference to “IOCON – I/O EXPANDER CONFIGURATION REGISTER (ADDR 0x05)”. Do I need to deal with this to set up how I communicate to the chip?
Edited by - erdc on 20/02/2007 18:41:06
Edited by - erdc on 20/02/2007 18:42:05