|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的$ T0 H: G5 z9 O
#include <avr/eeprom.h>
4 t. I+ u6 z- ?3 {; h. I3 avoid EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)
7 n. t1 `# [4 i C* X! w! j{
0 r5 A' ]" j' W* J eeprom_busy_wait();
0 c1 l! `; r4 g eeprom_write_block (p_header,eep_address, wr_number);3 n# f- T2 J: E9 P A2 Z$ E {
}7 w2 o( j3 o5 a( A) s7 d
" j0 S- w5 l' a' N+ H2 ?
void EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)
* n/ v8 l3 e7 D; {, ~! K+ E8 [{- [ W z, V8 G8 [
eeprom_busy_wait();! @2 ~, W4 U4 g/ @
eeprom_read_block (p_header,eep_address,rd_number);
6 v& w( |7 o* i, d+ e% z r5 R}; K7 Q' Y6 |3 v0 {" [/ q
|
|