C51 COMPILER V9.56.0.0   BSP                                                               03/14/2025 20:27:24 PAGE 1   


C51 COMPILER V9.56.0.0, COMPILATION OF MODULE BSP
OBJECT MODULE PLACED IN .\Objects\bsp.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE ..\source\bsp\bsp.c LARGE OPTIMIZE(8,SPEED) BROWSE INCDIR(..\source\app;
                    -..\source\bsp) DEBUG OBJECTEXTEND PRINT(.\Listings\bsp.lst) TABS(2) OBJECT(.\Objects\bsp.obj)

line level    source

   1          #include "bsp.h"
   2          
   3          /*************************************************************
   4           * 时钟初始化
   5           *************************************************************/
   6          void hal_clock_init(void)
   7          {
   8   1        CLKSWR = 0x51;            //选择内部高频RC为系统时钟，内部高频RC 2分频，Fosc=16MHz
   9   1        CLKDIV = 0x01;            //Fosc 1分频得到Fcpu，Fcpu=16MHz
  10   1        
  11   1        
  12   1        FREQ_CLK = 0x10;          //指明当前系统时钟  
  13   1        LVDC = 0xAC;              //LVD设置3.0V,禁止中断
  14   1        //  消抖时间 =  (0xFF + 2) * 1/Fcpu
  15   1        //       =  (0xFF + 2) / 16000000 （当前的CPU时钟）
  16   1        //       =  16.0625us
  17   1        LVDDBC = 0xFF;            //设置消抖时间
  18   1        LVDC &=~ 0x08;            //清除LVD中断标志位   
  19   1      }
  20          
  21          
  22          
  23          void bsp_init(void)
  24          {
  25   1        WDTCCR = 0x00;
  26   1        /* 时钟为16Mhz */
  27   1        hal_clock_init();
  28   1        /* 定时器周期定时为5ms */
  29   1        hal_timer_init();   // 5ms
  30   1        
  31   1        bsp_uart_init();
  32   1        bsp_adc_init();
  33   1      
  34   1      
  35   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     45    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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