C51 COMPILER V9.52.0.0   INTERRUPT                                                         03/30/2017 09:01:57 PAGE 1   


C51 COMPILER V9.52.0.0, COMPILATION OF MODULE INTERRUPT
OBJECT MODULE PLACED IN .\Interrupt.obj
COMPILER INVOKED BY: C:\Keil_v4\C51\BIN\C51.EXE ..\User\Source\Interrupt.c OMF2 BROWSE INCDIR(..\Library\FU68xx_Hardware
                    -_Driver\Include;..\User\Include) DEBUG PRINT(.\Interrupt.lst) TABS(2) OBJECT(.\Interrupt.obj)

line level    source

   1          /**************************** (C) COPYRIGHT 2015 Fortiortech shenzhen *****************************
   2          * File Name          : Interrupt.c
   3          * Author             : 
   4          * Version            : V2.0
   5          * Date               : 
   6          * Description        : This file contains all the interrupt function used for Motor Control.
   7          ***************************************************************************************************
   8          * All Rights Reserved
   9          **************************************************************************************************/ 
  10          
  11          
  12          /* Includes -------------------------------------------------------------------------------------*/
  13          #include <FU68xx.h>
  14          #include <Myproject.h>
  15          #include <LPF.h>
  16          
  17          
  18          
  19          /*-------------------------------------------------------------------------------------------------
  20            Function Name : void TIM0_ISR(void)
  21            Description   : 
  22            Input         : 无
  23            Output        : 无
  24          -------------------------------------------------------------------------------------------------*/
  25          void TIM0_ISR(void) interrupt 4
  26          {
  27   1        if(GetBit(TIM0_SR1, CC4IF))
  28   1        {
  29   2          /*软件启动ADC采样转换*/
  30   2          SetBit(ADC_STA, ADCBSY, 1);   
  31   2          CLR(TIM0_SR1, CC4IF);
  32   2        }
  33   1        
  34   1        if(GetBit(TIM0_SR1, UIF))
  35   1        {   
  36   2          CLR(TIM0_SR1, UIF);   
  37   2        }   
  38   1      
  39   1      }
  40          
  41          /*-------------------------------------------------------------------------------------------------
  42            Function Name : void ADC_ISR(void)
  43            Description   : ADC interrupt，包含ADC软件启动中断和ADC Trigger中断，中断优先级别为0
  44                            ADC软件启动中断--读取ADC转换数据
  45                            ADC Trigger中断--无
  46            Input         : 无
  47            Output        : 无
  48          -------------------------------------------------------------------------------------------------*/
  49          void ADC_ISR(void) interrupt 6
  50          {
  51   1        static uint16 ADCData_VoltageBUS =0;
  52   1        static uint16 ADCData_CurrentBUS =0;
  53   1        static uint16 ADCData_VoltageSREF =0;
  54   1        /*ADC转换完成中断*/  
C51 COMPILER V9.52.0.0   INTERRUPT                                                         03/30/2017 09:01:57 PAGE 2   

  55   1        if(GetBit(ADC_STA, ADCIF))
  56   1        {       
  57   2          
  58   2          /*获取ADC转换数据*/ 
  59   2          ADCData_VoltageBUS = ADC2_DR << 3;                     // Q12-->Q15
  60   2          ADCData_CurrentBUS = ADC4_DR << 3;                     // Q12-->Q15 
  61   2          ADCData_VoltageSREF = ADC7_DR << 3;                    // Q12-->Q15     
  62   2          
  63   2          /*对ADC采样数据做低通滤波*/ 
  64   2          /*LPF_K的大小关系到数字变换的到达实际数值的时间，*/
  65   2      
  66   2          ADCData.CurrentBUS = LPF(ADCData_CurrentBUS, ADCData.CurrentBUS, 8192);   
  67   2          ADCData.VoltageBUS = LPF(ADCData_VoltageBUS, ADCData.VoltageBUS, 8192);
  68   2          ADCData.VoltageSREF = LPF(ADCData_VoltageSREF, ADCData.VoltageSREF, 8192);  
  69   2          
  70   2          CLR(ADC_STA, ADCIF);
  71   2        } 
  72   1      
  73   1        
  74   1        if(GetBit(ADC_CFG, ADTRIGIF))
  75   1        { 
  76   2          CLR(ADC_CFG, ADTRIGIF);     
  77   2        }
  78   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    267    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      6    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


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