ADI 技术
直播中

宋晓媛

7年用户 310经验值
私信 关注
[问答]

ADuc7060/1 Flash读写出现OXFFFF

我Flash/EE 存储器进行读写,之前出现过能观看寄存器正确操作写入0X55AA 然后同样的地址读出来为0XFFFF
(错误值)。经过测试一段时间后重新建立工程,就出现了正确读到0X55AA的情况 。然后昨天又出现了读出的是OXFFFF
的情况,对于手头项目比较紧张,希望ADI公司能尽快帮我解决问题。附带FLASH 操作基本程序


unsigned short
Flash_Red(unsigned short FlashAddr)
{
unsigned short
FlashData;
unsigned char Status;
FEEMOD=FEEMOD|0x8; //Erase key
enable
FEEADR=FlashAddr;
FEECON=READ_HALF_WORD;
Status =
FEESTA&0x03;
while (!(Status)) Status = FEESTA&0x03;
if
((Status&0x02)==0x02) ERROR = 1;
FlashData=FEEDAT;
FEEMOD&=0xfff7;
//Erase key unable
return FlashData;
}

void ErasePage(unsigned
short FlashAddr )
{
unsigned char Status;
FEEMOD=FEEMOD|0x8; //Erase
key enable
FEEADR=FlashAddr;
FEECON=ERASE_PAGE;
Status =
FEESTA&0x03;
while (!(Status)) Status = FEESTA&0x03;
if
((Status&0x02)==0x02) ERROR = 1;
FEEMOD&=0xfff7; //Erase key
unable
}
void Flash_Write (unsigned short FlashAddr,unsigned short
FlashData)
{ unsigned char Status;
FEEMOD=FEEMOD|0x8; //Erase/Red key
enable
FEEADR=FlashAddr;

FEEDAT=FlashData;
FEECON=WRITE_HALF_WORD;
Status =
FEESTA&0x03;
while (!(Status)) Status = FEESTA&0x03;
if
((Status&0x02)==0x02) ERROR = 1;
FEEMOD&=0xfff7; //Erase key
unable
}

回帖(1)

张虎豹

2018-11-23 09:08:12
楼主,你好,
请参见以下连接:
http://bbs.ednchina.com/FORUM_POST_33_124163_0.HTM###
举报

更多回帖

发帖
×
20
完善资料,
赚取积分