大家好,我用编译器函数“EEPROMYRADE”实现代码,从EEPROM和“EEPROMYWORD”中读写。读取函数正在工作,但写不起作用。我做错了什么,还是需要初始化EEPROM?下面是EEPROM读代码读取EEPROM的地址0。如果没有写入,它将给我变量中的0xFF。下面是向EEPROM写入EEPROM的代码。如果我读EEPROM内存地址,它给我0xFF,即使我的功率循环控制器也得到同样的结果。
以上来自于百度翻译
以下为原文
Gree
tings Everybody,
I have implemented code using compiler function "eeprom_read" to read from eeprom and "eeprom_write" to write. Read function is working but write is not working. Anything i am doing wrong or do i need to initialize eeprom ?
Below is the eeprom read code to read address 0 of eeprom. If it is not written it will give me 0xFF in my variable.
dp = eeprom_read(0x00);
if(dp == 0xFF)
{
dp = 0;
}
Below is the code to write to eeprom
eeprom_write(0x00, 0x01);
After writting to eeprom if i read that eeprom memory address it gives me 0xFF and even if i power cycle the controller i get the same result 0xFF