导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→C51编程:请问各位大虾写at29c020的方法?

* 2178: C51编程:请问各位大虾写at29c020的方法?

   jiangfeng_hu 
jiangfeng_hu发表的帖子 

 C51编程:请问各位大虾写at29c020的方法?
我在写atmel公司的at29c020时,写入的数据不能稳定的实现
代码如下,请问是什么地方的问题:
不知是时序的问题还是延时方面的问题?

void wFlashUnit(unsigned int Addr,unsigned char dat)
{
  setOE_High;             //oe=high
  setFristCE_High;        //ce=high
  setWE_High;             //we=high

  Hdelay(500);            //delay 500 cycle

  Outport(4,Addr&0xff);            //low 8 bits address
  Outport(5,(Addr>>8)&0xff);       //high 8 bits address
  Outport(6,0x00);                 //disable
  //Hdelay(100);               
  Outport(8,dat);                  //write flash data port
  Hdelay(500);                     //delay 500 cycle 
 
  setFristCE_Low;                  //ce=low
  setWE_Low;                       //we=low
  Hdelay(1000);                    //delay 

  setWE_High;                      //we=high
  setFristCE_High;                 ce=high
  Hdelay(500);
}
//****************************************************************
void wFlashSector()
{
  unsigned int count;
 
  //write 0xaa to 0x5555;         
  wFlashUnit(0x5555,0xaa);
  //write 0x55 to 0x2aaa;
  wFlashUnit(0x2aaa,0x55);
  //write 0xa0 to 0x5555;
  wFlashUnit(0x5555,0xa0);
  Hdelay(1000);

  for(count=0x0000;count<=0x00ff;count++)
  {
    wFlashUnit(count,0xbc);             //例如:写0xbc到0x0000-0x00ff
  }
}

发表时间:2001年10月27日9:45:00

  
回复该帖

本主题共有 1 帖,分页:>>>>>该主题的所有内容[1]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

[上一篇帖子]:要建英文字库你先在设备的存储器里建一个英文字库,就用windows自带的字库e5x7.fnt就可以用
[下一篇帖子]:要不要我把资料email给你要不要我把资料email给你?