|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的
0 R& X# m% O) a6 }7 p#include <avr/eeprom.h>
) L( ~/ x ^7 o4 O! z6 W8 Dvoid EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)
. g+ n# r& G' u! L6 L{
: j8 g: B1 R! B5 u7 e eeprom_busy_wait();
" P' B* _0 L: G9 x2 y eeprom_write_block (p_header,eep_address, wr_number);6 l+ |7 Q, ~+ V; n/ E7 X: [
}, @! r) G' _1 ]
7 S) h8 t$ p3 C2 `8 `, G- y* H& Yvoid EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)
0 e% B0 O: \5 k{* j- ]/ }5 R/ ?, W% H6 i
eeprom_busy_wait();
2 U. D% U+ i( H. ] eeprom_read_block (p_header,eep_address,rd_number);6 u( P2 N2 r) H: U
}% B7 }. e3 X' r- [4 ~; n
|
|