mega88 EEPROM读写错误(Atmel studio 6 GCC)
使用的是mega88芯片,使用eeprom.h库函数,对EEPROM进行读写。读出的数据错误。。static uint32_t uint32Data __attribute__((section(".eeprom")));
/*0:FreqMin 1:alarmDataValue 2:*/
//先写
eeprom_busy_wait();
eeprom_write_dword (&uint32Data,FreqMin);
//再读
eeprom_busy_wait();
FreqMin = eeprom_read_dword(&uint32Data);
得到的数据错误,请高手指教。。
把static去掉。。。。 好的 ,有空我试试。我重新写了个EEPROM程序,读写都没有问题了。没有用EEPROM.h库的程序。。2005的GCC好像不支持mega88,不知道现在支持不了? 自带的EEPROM.H函数是能用的 没有问题的
页:
[1]