8.4.6 of the datasheet shows how to read the temp. So going by this:-
Default slave address is $5A. This is bits 1 to 7 of the first byte. Bit 0 is the read or write bit and as we are writing to the sensor this will be 0. The first byte sent will be $B4 (5A * 2 + 0).
Next byte sent will be $07 the ram address of the data.
Next byte sent will be the read address byte. Bit 0 of the read address is 1 so this will be $B5 (5A * 2 + 1). The PBP command will take care of this and the restart.
The I2C address needs to be a constant. So I would try:-
TEMP VAR BYTE[3]
I2CREAD DataPin,ClockPin,$B4,$07,[STR TEMP\3]
You may also need to add 'DEFINE I2C_HOLD 1'
Best of luck
Phil
Bookmarks