How to write and read the EEPROM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to write and read the EEPROM

1,760 次查看
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?

标签 (1)
0 项奖励
回复
1 回复

487 次查看
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 项奖励
回复