AVR內(nèi)部EEPROM讀寫實(shí)驗(yàn)
/*addr:地址;number:長度;p_buff:讀出數(shù)據(jù)存放指針*/
void eprom_read(unsigned int addr, unsigned char number, unsigned char *p_buff) {
while(EECR (1 EEWE));
EEARH = 0x00;
while(number --) {
EEARL = addr ++;
EECR |= (1 EERE);
*p_buff++ = EEDR;
}
}
/*EEPROM寫入函數(shù)*/
/*addr:地址;number:長度;p_buff:寫入數(shù)據(jù)存放指針*/
void eprom_write(unsigned int addr, unsigned char number, unsigned char *p_buff) {
EEARH = 0x00;
伺服電機(jī)相關(guān)文章:伺服電機(jī)工作原理
評論