⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x5325.lst

📁 51单片机C语言常用模块与综合系统设计实例精讲
💻 LST
字号:
C51 COMPILER V7.06   X5325                                                                 08/21/2006 15:16:04 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE X5325
OBJECT MODULE PLACED IN x5325.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE x5325.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include <./Atmel/at89x52.h>
   2          #include <stdio.h>
   3          #include "source.h"
   4          #include <intrins.h>
   5          #include  <absacc.h>
   6          #define DELAY   _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_()
   7          #define WREN    0x06
   8          #define SFLB    0x00
   9          #define WRDI    0x04
  10          #define RSDR    0x05
  11          #define WRSR    0x01
  12          #define READ    0x03
  13          #define WRITE   0x02
  14          void    x5325_write_byte(unsigned char  ch)
  15          {
  16   1              unsigned char   i=8;
  17   1              while(i--){
  18   2                      EEPROMSCK=0;_nop_();
  19   2                      if(ch&0x80)
  20   2                              EEPROMSI=1;
  21   2                      else
  22   2                              EEPROMSI=0;
  23   2                      ch<<=1;DELAY;
  24   2                      EEPROMSCK=1;DELAY;
  25   2              }
  26   1              EEPROMSCK=0;
  27   1      }
  28          
  29          unsigned char x5325_read_byte(void)
  30          {
  31   1              unsigned char   i=8;
  32   1              unsigned char   ddata=0;
  33   1              while (i--){
  34   2                      ddata<<=1 ;
  35   2                      EEPROMSCK=0;DELAY;
  36   2                      EEPROMSCK=1;DELAY;
  37   2                      ddata|=EEPROMSO;
  38   2              }
  39   1              EEPROMSCK=0;
  40   1              return ddata;
  41   1      }
  42          void    x5325_write_enable(){
  43   1              EEPROMCSN=0;
  44   1              x5325_write_byte(WREN);
  45   1              EEPROMCSN=1;
  46   1              DELAY;
  47   1      }
  48          void    x5325_write( struct x5324_page *p){
  49   1              unsigned char i;
  50   1              EEPROMWPN=1;
  51   1              x5325_write_enable();
  52   1              EEPROMCSN=0;
  53   1              x5325_write_byte(WRITE);
  54   1              x5325_write_byte(p->add.ar[0]); //addres high ;
  55   1              x5325_write_byte(p->add.ar[1]);//address l;
C51 COMPILER V7.06   X5325                                                                 08/21/2006 15:16:04 PAGE 2   

  56   1              //write_debug(" ",NULL);
  57   1              //write_debug("%d",(unsigned char *)&(p->add.nt));
  58   1              for(i=0;i<p->counter;i++)
  59   1                      x5325_write_byte(p->dat[i]);
  60   1              EEPROMCSN=1;
  61   1      }
  62          void    x5325_read( struct x5324_page *p){
  63   1              unsigned char i;
  64   1              EEPROMCSN=0;
  65   1              x5325_write_byte(READ);
  66   1              x5325_write_byte(p->add.ar[0]);
  67   1              x5325_write_byte(p->add.ar[1]);
  68   1              for(i=0;i<p->counter;i++)
  69   1                      p->dat[i]=x5325_read_byte();
  70   1              EEPROMCSN=1;
  71   1      }
  72          #undef  DELAY


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    312    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       7
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -