|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的
\" z5 n) W4 w: |) f#include <avr/eeprom.h>& g) _& I4 ?8 d$ W! [
void EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)% h6 y& u; N/ k2 W0 [
{ 5 [, Z+ f( ] E% z a0 P# d% s* y
eeprom_busy_wait();+ q8 r0 I9 ~& e: e; z
eeprom_write_block (p_header,eep_address, wr_number);
3 }; y7 b, m- a5 W& B0 s1 `' H}$ B8 A( _- m! M/ r7 d; {
6 X7 Q7 e4 ~4 P* `void EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)- s4 ^. E: q* o1 [( u
{
; b6 {: [( M0 G$ H& ? eeprom_busy_wait();4 |4 f3 ]" Y3 q5 L# K# `# G
eeprom_read_block (p_header,eep_address,rd_number);
; A9 O: H0 _' g0 A& Z; L$ a}( A' O8 O, t2 p+ }) p
|
|