Shop OBEX P1 Docs P2 Docs Learn Events
i2C_ROMEngine - Help — Parallax Forums

i2C_ROMEngine - Help

davidpzkdavidpzk Posts: 19
edited 2013-05-13 13:11 in Propeller 1
I seem to be having trouble writing a string to the EEPROM using i2C_ROMEngine.

The following code writes successfully to the rom
[SIZE=3]EEPROMxPORT.ROMEngineStart(29, 28, 0)
waitcnt (10000+cnt) 
EEPromxPORT.writeLong ($7fd0, string("TestWrite))
waitcnt (10000+cnt)
EEPROMxPORT.ROMEngineStop [/SIZE]



However this code writes blanks to the EEPROM. It seems the string is not being passed to the i2C_ROMEngine. I cant figure out why. Any ideas?
[SIZE=3]EEPROMxPORT.ROMEngineStart(29, 28, 0)
waitcnt (10000+cnt) 
bytemove (@TestData, string("TestWrite"))
EEPromxPORT.writeLong ($7fd0, @TestData))
waitcnt (10000+cnt)
EEPROMxPORT.ROMEngineStop [/SIZE]

Comments

  • localrogerlocalroger Posts: 3,451
    edited 2013-05-13 13:11
    ByteMove needs the length, and WriteLong writes four long-aligned bytes, so if TestData is a byte array it may not be aligned correctly.
Sign In or Register to comment.