打印

sst29sf040不是flash吗,为什么当作数据存储器时掉电数据会丢失

[复制链接]
2763|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
ccjchen|  楼主 | 2007-9-24 20:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
sst29sf040不是flash吗,为什么我把它当作数据存储器时一掉电数据就会丢失呢?
sst29sf040的A0-A7接74ls373的输出,74373集成在CPLD中,没画出来,A8-A14接AT89C52的P20-P26,而A15-A18接地,因为我用不到那么大的空间,而其片选端CE接AT89C52的P27 

void  ByteProgram(uchar data SrcByte,uint Dst)
{
    XBYTE[0x0555] = 0xAA;
    XBYTE[0x02AA] = 0x55;
    XBYTE[0x0555] = 0xA0;
    XBYTE[Dst]   = SrcByte;
    wait(1,9);//等待25us
}

int Erase_One_Sector(uint Dst)
{

        /*  Issue the Sector Erase command to 39SF040   */

        XBYTE[0x0555] = 0xAA; /* set up address to be 555h    */
                             /* write data 0xAA to the address     */
        XBYTE[0x02AA] = 0x55; /* set up address to be 2AAh    */
                             /* write data 0x55 to the address     */
        XBYTE[0x0555] = 0x80; /* set up address to be 555h    */
                             /* write data 0x80 to the address     */
        XBYTE[0x0555] = 0xAA; /* set up address to be 555h    */
                             /* write data 0xAA to the address     */
        XBYTE[0x02AA] = 0x55; /* set up address to be 2AAh    */
                             /* write data 0x55 to the address     */
        XBYTE[Dst]   = 0x20; /* set up starting address to be erased */
                             /* write data 0x30 to the address     */
        wait(85,134);        /* check DATABOOK for the most  */
                             /* accurate value -- Tse        */
}

uchar ByteRead(uint addr)
{
    uchar GetData;
    GetData = XBYTE[addr];
    return(GetData);
}
void sst_save()//用于保存易丢失数据
{
     uchar i;
    Erase_One_Sector(128);
           for(i=0;i<4;i++)
            {  
                
              ByteProgram(syn[2*i+1],0x0080+i);
              syn[2*i+1]=ByteRead(0x0080+i);
                
            }
}
void main()
{
   sst_save();我 在程序中改变syn 的值未写出,为什么我一断电,syn 的值还是原来的赋的初值呢?
}

相关帖子

沙发
ccjchen|  楼主 | 2007-9-25 18:20 | 只看该作者

难道没人用过sst29sf040吗?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

175

主题

446

帖子

1

粉丝