Shop OBEX P1 Docs P2 Docs Learn Events
PCF8574 problem — Parallax Forums

PCF8574 problem

Rudy.WRudy.W Posts: 10
edited 2008-01-08 15:40 in Propeller 1
·· I am using a PCF 8574 with the propeller and Burroughs I2C Object.
· ·I am using only bits 1, 2 and 3· and the following simplified code:

·· Repeat
····· N :=$F9
····· waitcnt(50_000_000+cnt)
··· · I2CObject.writeLocation($46,$00,N,8,8)
····· Output : 11111001·· So far so good.

····· However, when i connect led's to the other outputs they flash with· the·speed of the loop.

····· so the leds on·:
···· ·Outputs : 11111010·· and··· 11111011·· both flash· but they don't get a command to do so.

····· Anybody an idea??····

···· Rudy_W
·····

Post Edited (Rudy.W) : 1/8/2008 3:03:26 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-08 15:05
    I think it's because you're using writeLocation which is intended for use with EEPROMs and other devices that require an address. Essentially, this call sends a byte of address followed by a byte of data. In your case, the PCF8574 is interpreting the address as data and briefly setting the I/O pins to zeros (from your furnished address) before setting them to the desired value. Try using an address of N instead of $0 and you should see the flash go away.

    To really do what you want, you'll need to modify the Burroughs routines so they don't send an address byte if it's not needed.

    By the way, please include a subject when you start a thread. You can go back and add one to your initial message by clicking on the pencil icon in the right upper corner of your initial message.

    Post Edited (Mike Green) : 1/8/2008 3:10:59 PM GMT
  • Rudy.WRudy.W Posts: 10
    edited 2008-01-08 15:11
    Thanks Mike, problem solved. ( and patient still alive!!)

    Rudy ( from the Netherlands)
  • RaymanRayman Posts: 14,223
    edited 2008-01-08 15:40
    You might want to look at my PCF8574 code here:
    http://www.rayslogic.com/propeller/Programming/i2c/i2c.htm
Sign In or Register to comment.