I2C eeprom read write


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    It's not the I2C sensors i have tried several. If i scan them as sensor 2 then the code is stored correctly, if i scan them as sensor one the first byte is corrupted when stored I tried moving the eeprom to store starting at a different location other than address 0 this still returns a corrupt first byte but works otherwise. very odd.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Further testing reveals the codes are being stored correctly in the eeprom and can be read back and displayed with this code.

    This writes the codes correctly to the eeprom

    Code:
    VarA = 0
    I2CWRITE Scdeeprom,Sckeeprom,AT24C512B,VarA,[STR I2C1\8,STR I2C2\8]	'Load data into I2c eeprom

    This check works even after powering on/off so the data is in the eeprom ok and can be read back.

    Code:
    For VarA = 0 to 15               'Load I2C1 data from eeprom
    I2CREAD Scdeeprom,Sckeeprom,AT24C512B,VarA,[VarB1]	'Read data from I2c eeprom
    DEBUG HEX2 VarB1
    Next VarA
    However trying to put the codes back into the array variables with this code.

    Code:
    VarA = 0
    I2CREAD Scdeeprom,Sckeeprom,AT24C512B,VarA,[STR I2C1\8,STR I2C2\8]	'Read data from I2c eeprom
    Appears to work correctly but the first byte of I2C1 array is always corrupted? Could someone try and replicate the fault please.
    Last edited by retepsnikrep; - 13th July 2010 at 13:18.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Even when i manually fill the first byte of the array I2C(0) it is corrupted when next read strange.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts