|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的
* U& C( f) @# y* S6 Y#include <avr/eeprom.h>
$ n, u2 T/ k5 n- u5 z( I" V3 ^void EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)
/ D2 Q% C! W3 e9 A9 z{ # ]3 L0 |, b' K, k" Y" _
eeprom_busy_wait();
! X, u) R; ?( @7 W( R eeprom_write_block (p_header,eep_address, wr_number);) g, F% X% t* ~3 Z$ Z. O
}
+ h& C4 |, v: z# f6 w% h) i5 T6 Z' ]
void EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)5 T" Y% ?1 f6 ?
{1 ?5 {% o& R! p% n
eeprom_busy_wait(); S0 C- L9 Q; k, L
eeprom_read_block (p_header,eep_address,rd_number);
' d! j& o- Y, E$ {4 w* [- P7 Y% G}
$ D+ C3 F# s( s' m3 V! q4 x! I |
|