本帖最后由 zw_7627 于 2015-6-3 09:55 编辑
如题,请大家帮忙分析下原因。谢谢
void Eep_EraseAllEeprom(void)
{
FSTAT = 0x30U; /*Before launching a command, the ACCERR and FPVIOL bits in the FSTAT register must be clear*/
FCCOBIX = 0x00U;
FCCOB = 0x0900U; /*the Erase flash block command is 0x09*/
FCCOBIX++;
FCCOB = 0x0400;
FSTAT = 0x80U; /*FSTAT register (to launch command)Clear CCIF 0x80*/
}
初始化函数如下:
void Eep_Init(void)
{
FCLKDIV_FDIVLCK = 0x01U;
FCLKDIV_FDIV = 0x18U; /*选择FCLK时钟频率*/
FCNFG_CCIE = 0x00U; /*Flsh command命令执行完毕后不产生中断*/
FCNFG_IGNSF = 0x00U; /*在读数据的过程中如果检测到位错误,则报告*/
FCNFG_FDFD = 0x01U;
FCNFG_FSFD = 0x01U;
FERCNFG_DFDIE = 0x00U;
FERCNFG_SFDIE = 0x00U;
FSTAT_CCIF = 0x01U;
FSTAT_ACCERR = 0x01U;
FSTAT_FPVIOL = 0x01U;
FERSTAT_DFDIF = 0x01U;
FERSTAT_SFDIF = 0x01U;
DFPROT_DPOPEN = 0x01U; /*EEPROM不写保护*/
DFPROT_DPS = 0x00U;
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>