i2c and 24lc256 reads / writes problem
what am I doing wrong? Trying to simply read and or write to eeprom using the PASM I2C Driver object in the object exchange.
Is it simply because the variable is a long and the object pulls bytes?
var
long MemVarOne
Pub main
i2c.initialize(scl)
MemVarOne := Read_HighMem($8000)
Pub Read_HighMem(address)
return i2c.ReadLong(SCL,eepromAddress, address)
Pub Write_HighMem(address, data)
i2c.WriteLong(SCL,eepromAddress,address, data)
Is it simply because the variable is a long and the object pulls bytes?

Comments
Add something like this:
and try it.
James
eepromAddress = $A0
Still not going well. I must be overlooking something?
var long MemVarOne Byte MemVarTwo byte buffer[32] Pub main ser.start(31,30,0,19200) i2c.initialize(scl) MemVarTwo~ MemVarTwo := 66 writeIt readIt ser.str(string("[read ")) ser.dec(buffer[5]) ser.tx("]") Pri ms(Delay) Waitcnt((clkfreq / 1_000) * Delay + cnt) PRI readIt if i2c.ReadPage(28, EEPROM, eepromAddress, @MemVarTwo, 1) abort PRI writeIt | startTime if i2c.WritePage(28, EEPROM, eepromAddress, @MemVarTwo, 1) abort startTime := cnt repeat while i2c.WriteWait(28, EEPROM, eepromAddress) if cnt - startTime > clkfreq / 10 abortI solved it.
ser.str(string("[read ")) ser.dec(MemVarTwo) ser.tx("]")