int Erase_Entire_Chip
{
WORD far *Temp;
/* Issue the Chip Erase command to 39VF160 */
Temp = (WORD far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAAAA; /* write data 0xAAAA to the address */
Temp = (WORD far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x5555; /* write data 0x5555 to the address */
Temp = (WORD far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x8080; /* write data 0x8080 to the address */
Temp = (WORD far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAAAA; /* write data 0xAAAA to the address */
Temp = (WORD far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x5555; /* write data 0x5555 to the address */
Temp = (WORD far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x1010; /* write data 0x1010 to the address */
Delay_100_Milli_Seconds(); /* Delay Tsce time */
}
试试看吧。
估计是因为需要16Bits操作的原因吧,ST自己的范例文件是写入16位的数据
虽然Datasheet上表格是8位的数据
Writeflash(0x5555,0xAAAA);
Writeflash(0x2AAA,0x5555);
Writeflash(0x5555,0x8080);
Writeflash(0x5555,0xAAAA);
Writeflash(0x2AAA,0x5555);
Writeflash(0x5555,0x1010);
Waitfor_endofprg();
阅读(964) | 评论(0) | 转发(0) |