I tray out
I2CRead I2C_data,I2C_clock,$F1,0,[druck,druck2]
but it does not work at all. I find a lot of examples for Eeprom but not one for the sensor I use.
does some have any idea ?
Thanks
I tray out
I2CRead I2C_data,I2C_clock,$F1,0,[druck,druck2]
but it does not work at all. I find a lot of examples for Eeprom but not one for the sensor I use.
does some have any idea ?
Thanks
From what I can see in the data sheet you should be using this:
I2CRead I2C_data,I2C_clock,$F1,[druck,druck2]
I don't know what the 0 you had there was for but the R/W bit is set by the I2CRead/I2CWrite command, you don't need to set it.
also check what you have druck and druck2 declared as, byte or word.
i did a picture on the KO.
blue is clock and red are data.
and i can not read the sensor.
Last edited by Omalik; - 8th June 2008 at 17:46.
Now the sensor is working well
Thanks for all your help
The code I use is:
I2CRead I2C_data,I2C_clock,$F1,[druck]
an to calculate the mbar:
IF druck > 1999 then ' nur positive Druck auswerten
druck = ((druck - 2000) * 6) + ((druck - 2000) /4) ' * 25 / 100
else
druck = 0
endif
see also the printscreen from the I2C bus.
I am glad to see that you got it working![]()
Bookmarks