This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Understanding EEPROM

Other Parts Discussed in Thread: TM4C123GH6PGE

Hi,

I am trying to implement read/write on EEPROM for TM4C123GH6PGE . This is what i have read in datasheet

There are 32 blocks of 16 words each in the EEPROM. Bytes and half-words can be read, and
these accesses do not have to occur on a word boundary.

Q: i used EEPROMRead and it takes word only,then how can i read half-words ? 

The entire word is read and any unneeded
data is simply ignored. They are writable only on a word basis. To write a byte, it is necessary to
read the word value, modify the appropriate byte, and write the word back.

Q: I used  EEPROMProgram consecutively and i found that consecutive write overwrite the memory without the read as mentioned in datasheet ?

  • Hello Shubham,

    The second line "The entire word is read and any unneeded data is simply ignored" is handled by the CPU.

    if you run EEPROMProgram with doing a EEPROMRead to read the affected words, then it will overwrite. The correct method is to do a EEPROMRead, update the variables as required and then do a EEPROMProgram.

    Regards

    Amit

  • Hi,

    As i understood ,it is like if i have to write a byte then i have to read a word modify the corresponding byte and write it back .However , for writing a word i can simply overwrite the word but u suggest i should read word  first and then write it back . but doesn't that kill optimization for writing 2k i need to read 2k ?

  • Hello Shubham,,

    Yes, that is correct. You would need to read the word, update the byte and write back the word. It may be inefficient for a byte wise operation, but then the reverse would be true for a word wise operation.

    When it comes to 2K write operations, it would be sub-optimal from a byte access perspective.

    Regards

    Amit

  • Hi Amit,

    I m facing an issue with the implementation of EEPROM on Tiva Board .I tried writing 100 words on EEPROM starting with address 0x00 (first block ) . when i read from EEPROM , to my astonishment i am only able to read 32 words out of possible 100 words.as per my understanding 100 words should take 7 blocks and my data should persist on consecutive 7 blocks starting from first . and even if offset wrap back to 0 after 15 then maximum word stored should be 16 . Here is code snippet :

        for(temp = 0; temp < 100; temp++)
            buffer[temp] = 0xAAAAAAAA;

        for(temp = 0; temp < 100; temp++)
             buffer_read[temp] = 0xFFFFFFFF;

        status = EEPROMProgram(&buffer[0],0x00,sizeof(buffer));

        EEPROMRead(buffer_read,0x00, sizeof(buffer_read));

  • Hi,

    there is sometigh to consider:

    After enabling or resetting the EEPROM module, software must wait until the WORKING bit in the
    EEDONE register is clear before accessing any EEPROM registers

    Also could you do EEPROMStatusGet to see if there weren't any errors?

  • Hi Amit,

    Solved my problem but fell into a bigger one , how do i unlock the password protected block without password ?

  • Hi, 

    you can completely erase the eeprom with EEPROMMassErase,


    but it the eeprom should be untouch and empty from factory. Only the ROM is changed

  • yes , it worked thanks luis

  • Hi,

    I think the purpose could have met if we had used sector erase instead of mass erase . But i didn't find any peripheral library api for sector erase . Although its mention in datasheet EEPROM uses sector erase where each sector consist of two blocks . Is there any way i could do block erase or sector erase ?