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

📄 sys_isr.lst

📁 中颖单片机的基础驱动程序源代码ADC
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.07   SYS_ISR                                                               09/19/2008 15:20:03 PAGE 1   


C51 COMPILER V7.07, COMPILATION OF MODULE SYS_ISR
OBJECT MODULE PLACED IN .\Obj\sys_isr.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE App\sys_isr.c BROWSE DEBUG OBJECTEXTEND PRINT(.\List\sys_isr.lst) OBJECT(.\
                    -Obj\sys_isr.obj)

stmt level    source

   1          #include        ".\head\intrins.h"      
   2          #include        ".\head\CPU161.h"
   3          #include        ".\head\define.h"
   4          #include        ".\head\global.h"
   5          
   6          
   7          /****************************************************************************
   8           * Function Description:the interrupt entrance : INT0
   9           * Input parameter     :void
  10           * Output paramter     :void
  11           ****************************************************************************/
  12          void    INT0_ISP(void) interrupt 0
  13          {
  14   1              EA      = 0;            
  15   1              IE0 = 0;                                                                
  16   1              //-------------------
  17   1              //-------------------
  18   1              EA      =       1;      
  19   1      }
  20          /****************************************************************************
  21           * Function Description:the interrupt entrance : Timer0
  22           * Input parameter     :void
  23           * Output paramter     :void
  24           ****************************************************************************/
  25          void    Timer0_ISP(void) interrupt 1
  26          {
  27   1              EA      =       0;              
  28   1              TF0  = 0;                                                       
  29   1              //-------------------
  30   1              //-------------------
  31   1              EA      =       1;
  32   1      }
  33          /****************************************************************************
  34           * Function Description:the interrupt entrance : INT1
  35           * Input parameter     :void
  36           * Output paramter     :void
  37           ****************************************************************************/
  38          void    INT1_ISP(void) interrupt 2
  39          {
  40   1              EA      =       0;
  41   1              IE1 =   0;
  42   1              //-------------------
  43   1              //-------------------
  44   1              EA      =       1;
  45   1      }
  46          
  47          /****************************************************************************
  48           * Function Description:the interrupt entrance : Timer1
  49           * Input parameter     :void
  50           * Output paramter     :void
  51           ****************************************************************************/
  52          void    Timer1_ISP(void) interrupt 3
  53          {
  54   1              EA       = 0;
C51 COMPILER V7.07   SYS_ISR                                                               09/19/2008 15:20:03 PAGE 2   

  55   1              TF1  = 0;                                                       
  56   1              //-------------------
  57   1              //-------------------
  58   1              EA      =       1;
  59   1      }
  60          
  61          /****************************************************************************
  62           * Function Description:the interrupt entrance : EUART
  63           * Input parameter     :void
  64           * Output paramter     :void
  65           ****************************************************************************/
  66          void    EUART_ISP(void) interrupt 4
  67          {
  68   1              EA      =       0;
  69   1              EA      =       1;
  70   1      }
  71          
  72          /*************************************************************************************************
  73           * Function Description:the interrupt entrance : Timer2
  74           * Input parameter     :void
  75           * Output paramter     :void
  76           *************************************************************************************************/
  77          void    Timer2_ISP(void) interrupt 5
  78          {
  79   1              EA      =       0;      
  80   1              TF2 =   0;
  81   1              EXF2=   0;      
  82   1              //-------------------
  83   1              //-------------------
  84   1              EA      =       1;      
  85   1      }
  86          
  87          /*************************************************************************************************
  88           * Function Description:the interrupt entrance : ADC
  89           * Input parameter     :void
  90           * Output paramter     :void
  91           *************************************************************************************************/
  92          void    ADC_ISP(void) interrupt 6
  93          {
  94   1              static bit      bdata   pbADFirstTime;
  95   1              static Word data        pWADCBuf;
  96   1              static Byte data        pBADCSampleTime;
  97   1              static Byte data        pBADValue_T1_Buf;
  98   1              static Byte data        pBADValue_T2_Buf;
  99   1      
 100   1              Byte data channel;
 101   1              Byte data value;
 102   1      
 103   1              EA      =       0;              
 104   1              ADCON &= Bin(10111111);                                                                 //clear ADCIF
 105   1              //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/  
 106   1              pWADCBuf +=ADDH;                                                                                //accumulate 256 times
 107   1              if((++pBADCSampleTime)==0x00)                                                   
 108   1              {                                                                               
 109   2                      value   = HIBYTE(pWADCBuf);                                                     //get average value of 256 times
 110   2                      pWADCBuf = 0x0000;                                                                      //clear accumulate buffer
 111   2                      channel = (ADCON & Bin(00001110))>>1;                           //get current channel
 112   2                      switch(channel)
 113   2                      {
 114   3                              //I value---------------------------------------------------------------------------
 115   3                              case 0:                                 
 116   3                                      gBADValue_I = value;                                            //save I without debounce
C51 COMPILER V7.07   SYS_ISR                                                               09/19/2008 15:20:03 PAGE 3   

 117   3                                      channel ++;                                                                     //next channel
 118   3                                      break;
 119   3                              //T1 value--------------------------------------------------------------------------
 120   3                              case 1:                                                         
 121   3                                      if(pbADFirstTime)
 122   3                                      {       //not first time                
 123   4                                              if(pBADValue_T1_Buf == value)                   //equal with last time ?
 124   4                                              {
 125   5                                                      gBADValue_T1 = value;                           //save T1 for it's stable
 126   5                                                      gBT1 = TAB_TEMP[value];

⌨️ 快捷键说明

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