Shop OBEX P1 Docs P2 Docs Learn Events
Writing a byte and reading a byte from EEPROM — Parallax Forums

Writing a byte and reading a byte from EEPROM

PotatoPotato Posts: 18
edited 2010-02-23 07:59 in Propeller 1
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
smile.gif

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-02-23 07:59
    No idea what i2cobject is plus your syntax doesn't look right. Please archive your project and attach it so all the referenced objects are included too.

    Normally an i2cobject that reads a byte would require a device address which is normally in the $A0 range for EEPROMs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
Sign In or Register to comment.