|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的! L3 p, g# v0 b+ z& ~7 e" E3 @! w
#include <avr/eeprom.h>' x3 j) W* `- s1 x8 J" c, H) O
void EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)
3 v% k: f9 J g{ 5 M5 t% Q* N$ E+ f! X8 | @0 w
eeprom_busy_wait();% X$ |- Q" b& S) n' w
eeprom_write_block (p_header,eep_address, wr_number);* g, ?! j' ~1 {% H% k# w( a
}, N2 _. u; c8 i: \
% G4 M% |2 L$ G, m0 Nvoid EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)
. N. v+ o6 x) x7 v7 [, N{
6 D1 _8 k; W+ z' U" } eeprom_busy_wait();; M! O" M. \0 E; z2 T. Q' q7 J- a7 V
eeprom_read_block (p_header,eep_address,rd_number);
- _. S. Z+ W2 L6 b% }+ D}: T" @# s! w5 m' ~. o1 {
|
|