AVR内部EEPROM读写实验
ISPLAY: inline !important; FONT: 14px/25px Verdana; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">while(number --) {
while(EECR (1 EEWE));
EEARL = addr ++;
EEDR = *p_buff ++;
EECR |= (1 EEMWE);
EECR |= (1 EEWE);
}
}
/*主函数*/
void main(void) {
unsigned char temp;
DDRA = 0x00; /*方向输入*/
PORTA = 0xFF; /*打开上拉*/
DDRB = 0xFF; /*方向输出*/
PORTB = 0xFF; /*电平设置*/
DDRC = 0x00;
PORTC = 0xFF;
DDRD = 0x00;
1 2 3 4
while(EECR (1 EEWE));
EEARL = addr ++;
EEDR = *p_buff ++;
EECR |= (1 EEMWE);
EECR |= (1 EEWE);
}
}
/*主函数*/
void main(void) {
unsigned char temp;
DDRA = 0x00; /*方向输入*/
PORTA = 0xFF; /*打开上拉*/
DDRB = 0xFF; /*方向输出*/
PORTB = 0xFF; /*电平设置*/
DDRC = 0x00;
PORTC = 0xFF;
DDRD = 0x00;
1 2 3 4

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW
或用微信扫描左侧二维码