Shop OBEX P1 Docs P2 Docs Learn Events
Subadressing with I2C — Parallax Forums

Subadressing with I2C

Rudy.WRudy.W Posts: 10
edited 2007-11-06 19:22 in Propeller 1
· I am using a Philips PCF8591 AD converter and use it with a Propeller and I2C.

· I also use James Burroughs' I2C object but I get a problem· with adressing the 4 different A/D channels.

· here is the input statement i use:

··buicounts··:= I2CObject.readLocation(%1001_0011,%0000_0001,8,8) .

· According to the datasheet i sent the 8 bit address first, followed by the channel number(1), the·············· number·of· address bits (8) and the number of databits (8).

· It is always Channel 0 I get.

··What am i doing wrong?· Please help!

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-11-06 16:41
    In any case you should not set the LSB with 'deviceAddress'!
  • Rudy.WRudy.W Posts: 10
    edited 2007-11-06 19:05
    Thanks de Silva for your quick response.

    The way I understand it is the first byte the device address $ 93 and i added the second byte to be channel 1

    This is obviously not correct but I don't know where I am wrong
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-06 19:22
    The fixed address part of a 8591 is $90.
    Now it depends how you connect A1, A2, A3.. A1= Vdd will give you +$02
    The LSB is not part of the address, but a R/W indicator, you have to keep zero for the routines you use.
Sign In or Register to comment.