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

📄 c8051fini.lst

📁 this procedure is a game of basketball or subsystems time, the competition will record the entire ti
💻 LST
字号:
C51 COMPILER V8.02   C8051FINI                                                             11/10/2007 19:49:40 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE C8051FINI
OBJECT MODULE PLACED IN C8051Fini.OBJ
COMPILER INVOKED BY: E:\files\keil\C51\BIN\C51.EXE C8051Fini.c BROWSE INCDIR(..\usbtest) DEBUG OBJECTEXTEND

line level    source

   1          #include <c8051f020.h>
   2          #include <delay.h>
*** WARNING C318 IN LINE 2 OF C8051Fini.c: can't open file 'delay.h'
   3          
   4          void DisableWDT()
   5          {
   6   1              bit ea;
   7   1              ea=EA;
   8   1              EA=0;
   9   1              WDTCN=0x0DE;
  10   1              WDTCN=0x0AD;
  11   1              EA=ea;
  12   1      }
  13          
  14          bit GetWDTStatus()
  15          {
  16   1              char wdtcn;
  17   1              wdtcn=WDTCN;
  18   1              wdtcn>>=4;
  19   1              return (bit)wdtcn;
  20   1      }
  21          
  22          void SetWDTime(unsigned char time)
  23          {
  24   1              time|=0xF8;
  25   1              WDTCN&=0x78;
  26   1              WDTCN&=time;
  27   1      } 
  28          #define _ADC0_
  29          #define _DAC_
  30          
  31          void IniCPU()
  32          {       
  33   1              OSCXCN=0x67;            //set external xtal
  34   1              OSCICN=0x14;            //set internal xtal
  35   1      
  36   1              DisableWDT();           //disable watchdog
  37   1      
  38   1              P74OUT=0x3C;            //set port output mode
  39   1              P0MDOUT=0x01;
  40   1              P1MDOUT=0x0;
  41   1              P2MDOUT=0x00;
  42   1              P3MDOUT=0xfC;
  43   1      
  44   1              EMI0CN=0x7F;            
  45   1              EMI0CF=0x3c;            //XRAM config
  46   1              EMI0TC=0xFF;
  47   1      
  48   1              //REF config
  49   1              REF0CN=0x07;            //REF out enable
  50   1      
  51   1      #define _ADC1_
  52   1      #ifdef _ADC1_
  53   1              ADC1CF=0xf8;
  54   1              ADC1CN=0xc0;
C51 COMPILER V8.02   C8051FINI                                                             11/10/2007 19:49:40 PAGE 2   

  55   1      #endif
  56   1      
  57   1      #ifdef _ADC0_
  58   1              ADC0CF=0xf8;
  59   1              ADC0CN=0xc0;
  60   1      #endif  
  61   1      #ifdef _DAC_
  62   1              DAC0CN=0x80;
  63   1              DAC1CN=0x80;
  64   1      #endif
  65   1              
  66   1              XBR0=0xEf;                      //crossbar config
  67   1              XBR1=0x7f;
  68   1              //XBR0=0x04;                    
  69   1              XBR2=0xC0;
  70   1      }
  71          
  72          void UseExtal() 
  73          {
  74   1              unsigned char oscxcn;
  75   1              while(1)
  76   1              {
  77   2                      oscxcn=OSCXCN;
  78   2                      oscxcn>>=7;
  79   2                      if(oscxcn) 
  80   2                      {
  81   3                              OSCICN|=0x08;
  82   3                              //OSCICN&=0xfb;
  83   3                              break;
  84   3                      }
  85   2              }
  86   1      }
  87          
  88          int GetADC0(unsigned char channel)
  89          {
  90   1                      int ad;
  91   1                      AMX0SL=channel;
  92   1                      Delay1us(10);
*** WARNING C206 IN LINE 92 OF C8051FINI.C: 'Delay1us': missing function-prototype
*** ERROR C267 IN LINE 92 OF C8051FINI.C: 'Delay1us': requires ANSI-style prototype
  93   1                      AD0INT=0;
  94   1                      AD0BUSY=1;
  95   1                      while(AD0INT==0);
  96   1                      ad=ADC0H;
  97   1                      //ad&=0x87;
  98   1                      ad<<=8;
  99   1                      ad|=ADC0L;
 100   1                      return ad;
 101   1      } 
 102          
 103          void SetDAC0(int da)
 104          {
 105   1              DAC0L=(unsigned char )da;
 106   1              da>>=8;
 107   1              DAC0H=(unsigned char )da;
 108   1      }
 109          
 110          void SetDAC1(int da)
 111          {
 112   1              DAC1L=(unsigned char )da;
 113   1              da>>=8;
 114   1              DAC1H=(unsigned char )da;
C51 COMPILER V8.02   C8051FINI                                                             11/10/2007 19:49:40 PAGE 3   

 115   1      }

C51 COMPILATION COMPLETE.  2 WARNING(S),  1 ERROR(S)

⌨️ 快捷键说明

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