Shop OBEX P1 Docs P2 Docs Learn Events
Port Expander Object — Parallax Forums

Port Expander Object

AGCBAGCB Posts: 327
edited 2014-08-20 08:55 in Propeller 1
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

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-08-19 05:53
    JonnyMac wrote a driver that may be in the OBEX, but the site seems to be down right now.

    http://forums.parallax.com/showthread.php/148646-MCP23017-and-INT-question

    E
    DIT:That might have been his I2C driver?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-08-19 06:04
    AGCB wrote: »
    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

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-08-19 07:11
    This seemed to work ok - see attached.
  • AGCBAGCB Posts: 327
    edited 2014-08-19 17:26
    Excellent. Thanks much. Exactly what I was looking for and more.

    Aaron
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-08-19 20:08
  • AGCBAGCB Posts: 327
    edited 2014-08-20 04:34
    Thanks Jon

    Aaron
  • ksltdksltd Posts: 163
    edited 2014-08-20 08:55
    I've looked at the 23X17 and, to me, it's a solution looking for a problem.

    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.
Sign In or Register to comment.