I can't seem to Write properly to an I2C device
I can't seem to Read properly back from an I2C device
My I2C Serial EEPROM doesn't always save my data
I can't Write to the Registers on my I2C Real Time Clock, ADC etc



Check your I2CRead and IC2Write statements...

Do you have any CONSTANTS in the device address?

If so, your code is flawed... remove the constants and put in VARIABLES in their place...


Example: Write to location 8 on a 24LC32... these are NOT CORRECT...

I2CWrite SDA,SCL,$A0,$08,[DataA]
I2CWrite SDA,SCL,$A0,8,[DataA]
I2CWrite SDA,SCL,$A0,$0008,[DataA]
I2CWrite SDA,SCL,$A0,%00001000,[DataA]
I2CWrite SDA,SCL,$A0,%0000000000001000,[DataA]


Example: Write to location 8 on a 24LC32... this is CORRECT...

I2CAddress=8
I2CWrite SDA,SCL,I2CDevice,I2CAddress,[DataA]

where previously I2CAddress has been defined as a WORD, and I2CDevice has been defined as a BYTE and preloaded with $A0.

Remember that the type of VARIABLE I2CAddress must match the requirement for the device you are addressing... eg it's a WORD for devices like a 24LC32 or 24LC64, but it's a BYTE for other devices like a 24LC16 or DS1307 RTC. Check your device Datasheet.