首页 新闻资讯 技术资料 论坛 网站地图
AD/DA 嵌入式软件 接口电路 电源系列 软件开发 嵌入式硬件 综合电子技术
电子元器件搜索:
IC库存(8958万) PDF资料(329万) IC价格 IC求购 资讯 技术资料
维库电子市场网是知名的电子元器件交易网站, 为电子生产企业提供IC库存和技术资料查询服务。
位置: 首页 > 详细信息
  sst29sf040作为数据存储器时,为何掉电后数据恢复为初始化的值呢
出处:21ic 时间: 2007-09-25
ccjchen 发布于 2007-9-25 8:43:00
sst29sf040不是flash吗,难道数据会丢失吗?我仿真时看到数据也写进了sst29sf040阿,为什么一烧写进芯片后掉电数据就会恢复为初始化的值呢?
下面是我改变数组 syn 的值并存储到sst29sf040的程序
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();
}


关闭】 【打印
相关专题  
电源系列
消费电子
软件开发
嵌入式硬件
军工/航空航天
综合电子技术
接口电路
安防产品
传感控制
数控系统
工业控制
医疗电子
存储器
嵌入式系统
测试测量
SOPC
开发工具
嵌入式软件
IC设计
CPLD/FPGA
计算机外设
汽车电子
应用产品
嵌入式开发新闻
AD/DA

© 2007 百斯嵌入式开发网 网站地图