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

📄 93c66.lst

📁 本压缩文件主要介绍温度传感芯片的应用
💻 LST
字号:
C51 COMPILER V8.08   93C66                                                                 09/11/2007 22:56:25 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE 93C66
OBJECT MODULE PLACED IN 93C66.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 93C66.C BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include        <intrins.h>
   2          #include        <REGX51.h>
   3          //
   4          #define         READ            0x0C00  /* xxxx110A8,A7-A0 */
   5          #define         EWEN            0x0980  /* xxxx1001 ,1xxxxxxx */
   6          #define         WRITE           0x0A00  /* xxxx101A8,A7-A0 */
   7          #define         EWDS            0x0800  /* xxxx1000,0xxxxxxx */
   8          //
   9          #define         ShiftBit        4
  10          //
  11          #define         CS                      P2_7
  12          #define         SK                      P2_6
  13          #define         DI                      P2_5
  14          #define         DO                      P2_4
  15          //
  16          char code int2charx[]="0123456789ABCDEF";
  17          void                    write_command(int);
  18          unsigned char   read_byte(int);
  19          void                    write_byte(int,unsigned char);
  20          void                    check_busy(void);
  21          //
  22          unsigned char read_byte(int address)
  23          { 
  24   1              int i,command;  
  25   1              unsigned char temp;
  26   1      
  27   1              CS=1;
  28   1              command=(READ|address);  
  29   1              write_command(command);
  30   1              for(i=0;i<8;i++)                
  31   1              {
  32   2                      SK=1;
  33   2                      SK=0;
  34   2                      temp= (temp << 1);
  35   2                      if(DO==1)
  36   2                              temp=(temp | 0x01); 
  37   2              }       
  38   1              CS=0; 
  39   1              return(temp);       
  40   1      } 
  41          void write_enable()
  42          {
  43   1              int command;    
  44   1              CS=1;
  45   1              command=EWEN;
  46   1              write_command(command);         
  47   1              CS=0;
  48   1      }
  49          void write_disable()
  50          {
  51   1              int command;    
  52   1      
  53   1              CS=1;
  54   1              command=EWDS;
  55   1              write_command(command);         
C51 COMPILER V8.08   93C66                                                                 09/11/2007 22:56:25 PAGE 2   

  56   1              CS=0;
  57   1      }
  58          void write_byte(int address,unsigned char write_data)
  59          { 
  60   1              int i,command;  
  61   1      
  62   1              write_enable();
  63   1              CS=1;
  64   1              command=(WRITE|address);
  65   1              write_command(command);
  66   1              for(i=0;i<8;i++)        
  67   1              {
  68   2                      if(write_data & 0x80)
  69   2                              DI=1;
  70   2                      else 
  71   2                              DI=0;
  72   2                      SK=1;
  73   2                      SK=0;
  74   2                      write_data=(write_data<<1);
  75   2              }       
  76   1              check_busy(); 
  77   1              write_disable();
  78   1      }
  79          //
  80          void write_command(int command)
  81          {
  82   1              int i;
  83   1      
  84   1              command=(command<<ShiftBit);
  85   1              for(i=0;i<12;i++) {
  86   2                      if(command & 0x8000)
  87   2                              DI=1;
  88   2                      else
  89   2                              DI=0;   
  90   2                      SK=1;
  91   2                      SK=0;
  92   2                      command=(command<<1);            
  93   2              }  
  94   1      } 
  95          //
  96          void check_busy(void)
  97          {
  98   1              CS=0;
  99   1              CS=1;
 100   1              while(DO==0);
 101   1      }
 102          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    188    ----
   CONSTANT SIZE    =     17    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       4
   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 + -