|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的
/ t7 P& a. U' z2 J# A0 s#include <avr/eeprom.h>
5 }# a- z1 {6 Q" M! Y5 lvoid EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)) P, O/ K% t+ ^
{
6 V& o' V+ M i5 F% i eeprom_busy_wait();/ A) {; N7 {2 ^3 d' i3 C
eeprom_write_block (p_header,eep_address, wr_number);" ^6 y# A# s- u4 H
}! h' k: ^/ @5 A- Z( H
7 ?( n+ G8 u2 ^# a& Z+ Vvoid EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header)1 H. E5 ]7 ^5 C* t; m- e. { k
{
" G" r4 b8 m/ V* Y& C0 k* L eeprom_busy_wait();6 R1 Q( l4 R7 k' M6 ?, ?; Z
eeprom_read_block (p_header,eep_address,rd_number);
6 F( S3 ]$ H% D: f}& A; ^2 ~4 j' E
|
|