打印

LPC1114 接64Mb FLASH 程序与图片,待完善

[复制链接]
1543|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
金鱼木鱼|  楼主 | 2010-6-29 13:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
编的程序 , 有待完善 , 共同探讨!!!!!
顺便 秀一下 MAQ PC91 的无线耳麦, 下午刚到!!!共同交流!!!
extern  void WRITE_M_BYTE(uint8_t  M_BYTE ) //write  instruction  to flash
{
   uint8_t   j,commd;
   flash_cs0;
   asm("nop");
   asm("nop");
   flash_sclk0;
  for(j=0;j<8;j++)
      {
     commd=(M_BYTE>>j)%2;
  if(commd==0x01)
  {
         flash_din1;
  }
    else
       flash_din0;
      flash_sclk1;         //the instructions are latched on the rising edge                               //of serial clock
      asm("nop");
      asm("nop");
   asm("nop");
      asm("nop");
      flash_sclk0;
   asm("nop");
      asm("nop");
      }
}
extern  uint8_t  READ_M_BYTE()     //read  one byte from  flash
{
   uint8_t   i ,R_flash_data;
   for(i=0;i<8;i++)
    {
    asm("nop");
       asm("nop");
       dr= LPC_GPIO[PORT3]->MASKED_ACCESS[(1<<0)];
       dr=(dr>>8)%2;
       din[0]=dr;
       if(din[0]==0x01)
            {
           R_flash_data<<=1;
           R_flash_data|=0x01;
            }
        else
             {
            R_flash_data<<=1;
            R_flash_data|=0x00;
              }
     flash_sclk1;                  //data is shifted out on the falling edge of
                                   //serial  clock.
           asm("nop");
           asm("nop");
     asm("nop");
           asm("nop");
     flash_sclk0;
           asm("nop");
           asm("nop");
     asm("nop");
           asm("nop");
     asm("nop");
           asm("nop");
    }
    return  R_flash_data;
}

extern  void  flash_busy()  //busy or not
{
uint8_t   busy=0x01;
    flash_cs1;
    WRITE_M_BYTE(RDSR) ;   //Read  status  register  instruction
  do{
       busy=0x01;
       busy=READ_M_BYTE() ;   //Read   status  byte.
       busy&=0x01;   
}
    while(busy==0x01);
  flash_cs1;
  asm("nop");
     asm("nop");
  asm("nop");
     asm("nop");
}

extern  void  R_gps_flash(uint8_t  count,uint8_t *address)   //read  the  gps  information form  flash
{
  uint8_t  i;
  WRITE_M_BYTE(WREN) ;        //write  Enable  instruction;
  flash_busy();               //busy  or  not
  flash_cs1;
  WRITE_M_BYTE(READ);
  write_flashadd(address);    //WRITE THE INITIAL ADDRESS FOR READING
  for(i=0;i<count;i++)
      {
    gps905=READ_M_BYTE();
   }
  flash_cs1;
  flash_busy();
  //WRITE_M_BYTE(WRDI) ;     //the write disable instruction resets the write enable latch bit.
}


附件 EEWORLD提示:为减少服务器的压力,请尽量不要使用迅雷等下载软件。 IMG_4999.JPG (410.14 KB) 2010-5-7 16:31

IMG_5006.JPG (366.97 KB) 2010-5-7 16:31

相关帖子

沙发
LPC300| | 2010-6-29 13:03 | 只看该作者
来看看 呵呵 M0可是稀罕物哦 楼主用着感觉如何?

使用特权

评论回复
板凳
linux1| | 2010-6-29 13:06 | 只看该作者
实用 , 方便!!, 速度较一般的可以!!

使用特权

评论回复
地板
hotpower| | 2010-7-4 00:45 | 只看该作者
~~~

使用特权

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

本版积分规则

346

主题

1551

帖子

2

粉丝