本帖最后由 fzj 于 2012-12-22 20:48 编辑
一直卡在FLASH擦除函数中 ,(查询FMCON BIT3或者BIT0 没有任何变化),不知道哪里出错了,手册看了N遍,也没什么设置不对的地方,请老师帮分析下,谢谢
void Flash_erase (unsigned int address)
{ //unsigned char i=0;
FMUSR=0XA5;
FMSECL=(address&0xff);
FMSECH=(address>>8);
FMCON=0XA1;
nop();
nop();
while (FMCON&0X1 ); // while (FMCON&0X8 );
FMUSR=0;
//FMCON=0;
nop();
nop();
}
void Flash_erase (unsigned int address)
{ //unsigned char i=0;
do{
FMUSR=0XA5;
FMSECL=(address&0x00ff);
FMSECH=(address>>8);
FMCON=0XA1;
nop();
nop();
FMUSR=0;
}
while (FMCON&0X8 ); // while (FMCON&0X1 );
//FMCON=0;
nop();
nop();
} |