AVR_GCC_EEPROM程序
#include<avr/io.h>
#includeinterrupt.h>
#include
int main()
{
unsigned char val;
eeprom_busy_wait(); //等待EEPROM讀/寫就緒
eeprom_write_byte(0,0xaa); //將0XAA寫入到單片機(jī)內(nèi)部EEPROM的0地址處
eeprom_busy_wait(); //等待EEPROM讀/寫就緒
val=eeprom_read_byte(0); //從單片機(jī)內(nèi)部EEPROM的0地址處讀取一字節(jié)賦給變量val
while(1)
{
; //主程序
}
}
評論