How to write and read the EEPROM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to write and read the EEPROM

1,599 Views
syf
Contributor I

Hi,guys

 

I'm wondering how to write and read the EEPROM of MC9S12DG128.

 

I've found many articales about the EEPROM,but they only talk about how to write it,nearly no read

 

operation,can it be read?

Labels (1)
0 Kudos
1 Reply

326 Views
nandu
Contributor III

Hi Syf,

 

You can directly ready the EEPROM memory location as shown below

 

void read_eeprom(void)

    unsigned int eepromData;

    eepromData = *(unsigned int*)(0x800);

}

 

in which "0x800" is the EEPROM memory location from where you want to read the data.

 

Check the attached file, for the example of writing EEPROM memory

Message Edited by nandu on 2009-07-28 05:30 AM
0 Kudos