Writing a byte and reading a byte from EEPROM
Potato
Posts: 18
The purpose of the following program is to see if I am successfully writing to EEPROM:
repeat
i2cObject.WriteByte(28,0,$7000,%1111_0111)
Serial.str(String(" Write "))
waitcnt(clkfreq*1 + cnt)
xyzzy := i2cObject.ReadByte(28,0,$7000)
if xyzzy := (%1111_1111)
Serial.str(String(" it's ones "))
waitcnt(clkfreq*1 + cnt)
I I always get "it's ones" regardless if I write 1111_1111 or 111_0111.
xyzzy is defined as a variable byte.
Any help would be appreciated !
Thanks
repeat
i2cObject.WriteByte(28,0,$7000,%1111_0111)
Serial.str(String(" Write "))
waitcnt(clkfreq*1 + cnt)
xyzzy := i2cObject.ReadByte(28,0,$7000)
if xyzzy := (%1111_1111)
Serial.str(String(" it's ones "))
waitcnt(clkfreq*1 + cnt)
I I always get "it's ones" regardless if I write 1111_1111 or 111_0111.
xyzzy is defined as a variable byte.
Any help would be appreciated !
Thanks
Comments
Normally an i2cobject that reads a byte would require a device address which is normally in the $A0 range for EEPROMs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*