It always would help to have additional information, like how you have it hooked up and the like. But I do think the problem is your first I2COut, which does not give an Address to write to and the data to write to it. Here is a copy of an I2C function I played with a long time ago. So don't know if it still works...
Code:
; SRF helper functions
SRF08a Con 0xE0 ' 1st Sonar I2C Address
SRFCmdReg Con 0 ' Sonar Command register
SRFLightReg Con 1 ' Sonar Light sensor register
SRFRangeReg Con 2 ' Sonar 1st Range register
srfLightVal Var Byte ' Light sensor
srfAdr var Byte
srfRange Var Word ' 16 bit variable for Range
SRFPing[srfAdr]
; Warning this has not been tested to see if it works or not...
I2COut SDA, SCL, SRFPFail, srfAdr, [SRFCmdReg, 80] ; do a ping in inches...
srfRange = 0
pause 67
; lets try to wait until the Ping completes
I2COut SDA, SCL, SRFPFail, srfAdr, [SRFRangeReg]
i2cin SDA, SCL, SRFPFail, srfAdr, [srfRange.HighByte, srfRange.LowByte]
; lets try to wait until the Ping completes
;i2cin SDA, SCL, srfAdr, SRFRangeReg, [srfRange.HighByte, srfRange.LowByte]
return srfRange
SRFPFail
return 0xffff
SRFLight[srfAdr]
i2cin SDA, SCL, srfAdr, SRFLightReg, [SRFLightVal]
return srfLightVal
Kurt