Richard,
now i got a bit comfused. If i only add the following, it doent work as expected
all that's needed
reg = $07
addr = %10110100
i2cread SDA, SCL,addr,reg,[temp.lowbyte,temp.highbyte] ' reg = $07 ;would be the normal pbp way
But if i add the write mode and I2Cwrite command it works.
Code:
reg = $07 ' this is the register for IR temp mode
addr= %10110100 ; this is the write mode
i2cwrite SDA, SCL, addr
i2cread SDA, SCL, addr, reg, [TEMP.lowbyte, TEMP.highbyte]
the following also works.
Code:
reg = $07 ' this is the register for IR temp mode
addr= %10110100 ; this is the write mode
i2cwrite SDA, SCL, addr
addr= %10110101 ; this is the read mode
i2cread SDA, SCL, addr, reg, [TEMP.lowbyte, TEMP.highbyte]
if i do not add the following line the code doesnt work.
Code:
i2cwrite SDA, SCL, addr
Shouldnt we write first and then read? ok i understand that we have nothing to write. But why it doent work if i do not add the i2cwrite line?
Bookmarks