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

📄 main.lst

📁 xc164的空间矢量调制的恒压频比控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
  167  1          ///  Initialization of the SYSCON0 Register:
  168  1          ///  ---------------------------------------------------------------------
  169  1      
  170  1          //// this register must be set in the start-up file
  171  1          //// SYSCON0  =  0x0000
  172  1      
  173  1          ///  ---------------------------------------------------------------------
  174  1          ///  Initialization of the SYSCON1 Register:
  175  1          ///  ---------------------------------------------------------------------
  176  1          ///  clock prescaler for system is fpll / 1
  177  1          ///  clock prescaler for PD+ bus is fcpu / 1
  178  1      
  179  1          //// this register must be set in the start-up file
C166 COMPILER V6.02, MAIN                                                                  08/11/2006 11:28:55 PAGE 4   

  180  1          //// SYSCON1  =  0x0000
  181  1      
  182  1          ///  ---------------------------------------------------------------------
  183  1          ///  Initialization of the SYSCON3 Register:
  184  1          ///  ---------------------------------------------------------------------
  185  1      
  186  1          //// this register must be set in the start-up file
  187  1          //// SYSCON3  =  0x0000
  188  1      
  189  1        //// -----------------------------------------------------------------------
  190  1        //// End of Important Settings for the Start-Up File
  191  1        //// -----------------------------------------------------------------------
  192  1      
  193  1      
  194  1        //   -----------------------------------------------------------------------
  195  1        //   Initialization of the Peripherals:
  196  1        //   -----------------------------------------------------------------------
  197  1      
  198  1        //   initializes the General Purpose Timer Unit (GPT1)
  199  1        GPT1_vInit();
  200  1      
  201  1        //   initializes the Capture / Compare Unit 6 (CCU6)
  202  1        CCU6_vInit();
  203  1      
  204  1        // USER CODE BEGIN (Init,3)
  205  1      
  206  1        // USER CODE END
  207  1      
  208  1        //   globally enable interrupts
  209  1        PSW_IEN        =  1;          
  210  1      
  211  1      } //  End of function MAIN_vInit
  212         
  213         
  214         //****************************************************************************
  215         // @Function      void MAIN_vUnlockProtecReg(void) 
  216         //
  217         //----------------------------------------------------------------------------
  218         // @Description   This function makes it possible to write one protected 
  219         //                register. After calling of this function and write on the 
  220         //                protected register is the security level set to low 
  221         //                protected mode.
  222         //
  223         //----------------------------------------------------------------------------
  224         // @Returnvalue   None
  225         //
  226         //----------------------------------------------------------------------------
  227         // @Parameters    None
  228         //
  229         //----------------------------------------------------------------------------
  230         // @Date          2006-8-11
  231         //
  232         //****************************************************************************
  233         
  234         // USER CODE BEGIN (UnlockProtecReg,1)
  235         
  236         // USER CODE END
  237         
  238         void MAIN_vUnlockProtecReg(void)
  239         {
  240  1        ubyte ubPASSWORD;
  241  1      
C166 COMPILER V6.02, MAIN                                                                  08/11/2006 11:28:55 PAGE 5   

  242  1        if((SCUSLS & 0x1800) == 0x0800)      // if low protected mode
  243  1        {
  244  2      
  245  2          ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 245 OF MAIN.C: '=': value truncated
  246  2          ubPASSWORD = ~ubPASSWORD;
  247  2          SCUSLC = 0x8E00 | ubPASSWORD;      // command 4
  248  2      
  249  2        }  // end if low protected mode
  250  1      
  251  1        if((SCUSLS & 0x1800) == 0x1800)      // if write protected mode
  252  1        {
  253  2          SCUSLC = 0xAAAA;                   // command 0
  254  2          SCUSLC = 0x5554;                   // command 1
  255  2      
  256  2          ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 256 OF MAIN.C: '=': value truncated
  257  2          ubPASSWORD = ~ubPASSWORD;
  258  2      
  259  2          SCUSLC = 0x9600 | ubPASSWORD;      // command 2
  260  2          SCUSLC = 0x0800;                   // command 3; new PASSWOR is 0x00
  261  2      
  262  2          ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 262 OF MAIN.C: '=': value truncated
  263  2          ubPASSWORD = ~ubPASSWORD;
  264  2          SCUSLC = 0x8E00 | ubPASSWORD;      // command 4
  265  2      
  266  2        }  // end if write protected mode
  267  1      
  268  1      } //  End of function MAIN_vUnlockProtecReg
  269         
  270         
  271         //****************************************************************************
  272         // @Function      void main(void) 
  273         //
  274         //----------------------------------------------------------------------------
  275         // @Description   This is the main function.
  276         //
  277         //----------------------------------------------------------------------------
  278         // @Returnvalue   None
  279         //
  280         //----------------------------------------------------------------------------
  281         // @Parameters    None
  282         //
  283         //----------------------------------------------------------------------------
  284         // @Date          2006-8-11
  285         //
  286         //****************************************************************************
  287         
  288         // USER CODE BEGIN (Main,1)
  289         
  290         // USER CODE END
  291         
  292         void main(void)
  293         {
  294  1        // USER CODE BEGIN (Main,2)
  295  1      
  296  1        // USER CODE END
  297  1      
  298  1        MAIN_vInit();
  299  1      
  300  1        // USER CODE BEGIN (Main,4)
C166 COMPILER V6.02, MAIN                                                                  08/11/2006 11:28:55 PAGE 6   

  301  1        TPWM = PWMFrequency[9];
  302  1       // CCU6_T12PR     =  TPWM;      // load CCU6 T12 period register
  303  1        
  304  1        while(1);
  305  1        // USER CODE END
  306  1      
  307  1      } //  End of function main
  308         
  309         
  310         
  311         // USER CODE BEGIN (MAIN_General,10)
  312         
  313         // USER CODE END
  314         


MODULE INFORMATION:   INITIALIZED  UNINITIALIZED
  CODE SIZE        =         144     --------
  NEAR-CONST SIZE  =    --------     --------
  FAR-CONST SIZE   =    --------     --------
  HUGE-CONST SIZE  =    --------     --------
  XHUGE-CONST SIZE =    --------     --------
  NEAR-DATA SIZE   =           2     --------
  FAR-DATA SIZE    =    --------     --------
  XHUGE-DATA SIZE  =    --------     --------
  IDATA-DATA SIZE  =    --------     --------
  SDATA-DATA SIZE  =    --------     --------
  BDATA-DATA SIZE  =    --------     --------
  HUGE-DATA SIZE   =    --------     --------
  BIT SIZE         =    --------     --------
  INIT'L SIZE      =    --------     --------
END OF MODULE INFORMATION.


C166 COMPILATION COMPLETE.  3 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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