问答

汇集网友智慧,解决技术难题

panxiaoyi

TA的家园币:1231  

  • PIC47Q10读写EEPROM,我是用的MCC生成的代码,会有错误吗?

    MCC生成的代码如下:voidWR_EEPROM(uint16_tbAdd,uint8_tbData){uint8_tGIEBitValue=INTCONbits.GIE;NVMADRU=0x31;NVMADRH=(uint8_t)((bAdd&0xFF00)>>8);NVMADRL=(uint8_t)(bAdd&0x00FF);NVMDATL=(uint8_t)(bData&0xFF);NVMCON0bits.NVMEN=1;INTCONbits.GIE=0;NVMCON2=0x55;NVMCON2=0xAA;NVMCON1bits.WR=1;while(NVMCON1bits.WR){}NVMCON0bits.NVMEN=0;INTCONbits.GIE=GIEBitValue;}uint8_tRD_EEPROM(uint16_tbAdd){NVMADRU=0x31;NVMADRH=(uint8_t)((bAdd&0xFF00)>>8);NVMADRL=(uint8_t)(bAdd&0x00FF);NVMCON1bits.RD=1;NOP();NOP();return(NVMDATL);}

    EEPROM 读写 pic 代码 AD ui

    2021-08-05 4