Subadressing with I2C
Rudy.W
Posts: 10
· 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!
· 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
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
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.