Shop OBEX P1 Docs P2 Docs Learn Events
PCA9501 Addressing (Newbie) — Parallax Forums

PCA9501 Addressing (Newbie)

sparky88sparky88 Posts: 1
edited 2004-09-16 04:57 in BASIC Stamp
confused.gif·I am having trouble addressing my PCA9501 I/O expander chip.· I can't seem to access the I/O pins.· I have had success with PCF8574A, but no luck with PCA9501.· I'm using the right voltage (3.3v) and pull·up resistors (1.6K)for·SDA and SCL ( as per the data sheet) but I can' get the I/O pins to go low. All addressing pins are grounded.
Thanks for any help.

'{$STAMP BS2p}

·X CON 500
·ADDRESS CON %0000000
·MAIN:
·I2COUT 0, ADDRESS,[noparse][[/noparse]%00000000]
·· PAUSE· X
·I2COUT 0, ADDRESS,[noparse][[/noparse]%11111111]
·· PAUSE· X
·GOTO MAIN:

Comments

  • NewzedNewzed Posts: 2,503
    edited 2004-09-15 16:48
    The pins won't go low by themselves.· You have to pull them low.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Try the Stamp Tester

    http://hometown.aol.com/newzed/index.html
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-16 04:57
    Sometimes those "single register" devices have an internal buffer. Modify your program to write each new value twice so that the second write actually pushes the first from the buffer to the output.

    I2COUT 0, slvAddr, [noparse][[/noparse]%00000000, %00000000]
    PAUSE 500
    I2COUT 0, slvAddr, [noparse][[/noparse]%11111111, %11111111]
    PAUSE 500

    The data shee shows a FET between each IO pin and Vss, so I don't think you have to pull the outputs low. In fact, the data shee suggests you pull then high if you're going to use them as inputs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.