|
没用过ATMEGA329P,用ATMEL16\32,用它的库来读写EEPROM,这是用AVR编译器的
3 ?" m6 v) _$ F" N#include <avr/eeprom.h>
6 ]' E9 B8 o, D3 n9 ^void EEPROM_WRITE(unsigned char eep_address,unsigned char wr_number,unsigned char* p_header)
* F! j1 M' B3 @/ }/ }( f{
' J- z! s: m/ l8 M: D5 B4 Z eeprom_busy_wait();6 n; `$ M9 y5 N: T8 r; e) J
eeprom_write_block (p_header,eep_address, wr_number);1 f) T; T7 O! H4 a2 v' H# ~: m
}# d& x" A. o. i2 l- Z
& ?& O- O; F( e' ~( t1 @; E y
void EEPROM_READ(unsigned char eep_address,unsigned char rd_number,unsigned char * p_header). b1 m7 c' E7 C: `) ~" T; W; U
{
* }4 d& ~7 j2 W% D% J eeprom_busy_wait();+ L% v/ v) W* _/ s0 x% p8 p5 S r
eeprom_read_block (p_header,eep_address,rd_number);$ I. P6 V( k6 n
}7 @/ e3 u* \' I
|
|