Chinaunix首页 | 论坛 | 博客
  • 博客访问: 592749
  • 博文数量: 169
  • 博客积分: 2656
  • 博客等级: 少校
  • 技术积分: 1685
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 13:03
文章分类

全部博文(169)

文章存档

2011年(1)

2010年(135)

2009年(33)

我的朋友

分类: 嵌入式

2010-07-23 10:44:03

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) |
给主人留下些什么吧!~~