Any experience with PCA9501

Posted on
  • The PCA9501 is an 8-bit I/O expander with an on-board 2-kbit EEPROM.
    It has six address pins with internal pull-up resistors allowing up to 64 devices

  • I don't, but it looks quite straightforward according to the datasheet.

    Seems like a simple I2C2.writeTo(addr, my8databits) would set the outputs, I2C2.readFrom(addr,1) would read them.

    EEPROM looks pretty easy as well, but the address you use has the 7th bit set, so you'd need: I2C2.writeTo(addr|64, ...) to access it.

  • Never seen anything like it, but it sure looks like a very handy part for many projects. I love the interrupt delegation and the small EEPROM.

    It seems to me that it should be relatively straight forward to use the I2C module with writeTo(address, data, ...) and readFrom(address, quantity). For the interrupt you can use setWatch(function, pin, options).

    EDIT: Gordon beat me to it :p I forgot to press Post after I was done typing... typical

  • got one :-)

    3f is the GIPO extender and 7f is the eeprom.

    pi@rpi001 ~ $ i2cdetect -a -y 1
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f 
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 7f 
    

    to change the address ground the Ax ports.
    A0 to ground will change the address to 3e and 7e

    Seems like a simple I2C2.writeTo(addr, my8databits) would set the outputs, I2C2.readFrom(addr,1) would read them.

    can confirm that, tried with i2cset and i2cget.

    next step do some i2c test in espruino.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Any experience with PCA9501

Posted by Avatar for MaBe @MaBe

Actions