Port Expander Object
AGCB
Posts: 327
I've searched but been unable to find an object or partial for one of the port expander chips (Microchip MCP23017 or the Cypress chip). I have purchased the MCP and am starting to try to learn how to use it. Please point me in the right direction if you can. Thanks.
Aaron
Aaron
Comments
http://forums.parallax.com/showthread.php/148646-MCP23017-and-INT-question
EDIT:That might have been his I2C driver?
Don't know if it is in the OBEX, but it is in this post http://forums.parallax.com/showthread.php/107967-mcp23017-(i2c)-example-code?p=1048353&viewfull=1#post1048353
Aaron
Aaron
The drawback of the 23X17 are four fold. First, it's physically quite large. Second, because all of its IO pins all power up as inputs, determinism on reset requires pull resistors and that requires more parts and more board space. With 16 GPIOs all in one place, it tends to make a bit of a PCB routing mess. And finally, it requires a pile of initialization code that chews up memory.
The only real up side is that it can be daisy chained onto the I2C pins used for the required serial EEPROM but that rarely seems like a good idea in most applications because it means that EEPROM accesses must be synchronized with access to all of the expanded IO and that makes the timing of IO non-deterministic.
I use 74HC165s for expanded input and 74HC594s for expanded output. Infinite expansion with 4 GPIOs, distributed around the board so that they're physically near to where they need to be and determinism at reset without additional components. Total source code statements to write 32 outputs and read 32 inputs: 9 lines. Total source code statements to initialize: 0 lines.