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

📄 main.lst

📁 等精度频率计 利用51单片机实现 有源码以及执行文件
💻 LST
字号:
C51 COMPILER V7.00  MAIN                                                                   05/17/2008 18:51:12 PAGE 1   


C51 COMPILER V7.00, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include <reg52.h>
   2          #include <INTRINS.H>
   3          #include <math.H>
   4          #include <stdio.H>      
   5          #include "LCD1602.h"
   6          
   7          #define UART_ASK 0xA5
   8          
   9          sbit GATE = P3^2;
  10          sbit OPEN = P1^0;
  11          sbit CLRP = P3^5;
  12          
  13          //定义CPLD内部计数器地址
  14          unsigned char xdata REG0 _at_ 0xfff0;
  15          unsigned char xdata REG1 _at_ 0xfff1;
  16          unsigned char xdata REG2 _at_ 0xfff2;
  17          unsigned char xdata REG3 _at_ 0xfff3;
  18          
  19          unsigned char str_buff[30];
  20          unsigned char counter;
  21          
  22          void timer0_init()
  23          {
  24   1              TMOD|=0x09;
  25   1              ET0=1;
  26   1              EA=1;
  27   1              TR0=0;  
  28   1      }
  29          
  30          void delay_ms(unsigned int n)
  31          {
  32   1           unsigned char j;
  33   1           while(n--)
  34   1           for(j=0;j<230;j++);//230是实验测试所得!
  35   1      }
  36          
  37          main()
  38          {
  39   1              double fx,temp;
  40   1              uint temp1;
  41   1              lcd1602_init();
  42   1              timer0_init();
  43   1              OPEN=0;
  44   1      
  45   1              lcd_put_xys(1,1,"Welcometostuelab");    
  46   1      
  47   1              while(1)
  48   1              {                       
  49   2                      OPEN=0;
  50   2                      temp1=0;
  51   2                      while(GATE)
  52   2                              if(temp1++>65000) break;//超时跳出
  53   2                      CLRP=1;         
  54   2                      CLRP=0;
  55   2                      TH0=0; 
C51 COMPILER V7.00  MAIN                                                                   05/17/2008 18:51:12 PAGE 2   

  56   2                      TL0=0;
  57   2                      counter=0;
  58   2                      TR0=1;
  59   2                      OPEN=1;
  60   2                      while(counter<1);
  61   2                      OPEN=0;
  62   2                      temp1=0;
  63   2                      while(GATE)
  64   2                                      if(temp1++>65000) break;//超时跳出
  65   2                      TR0=0;
  66   2                      temp=counter*65536+TH0*256+TL0;         
  67   2                      fx=1843200/temp;//(22118400/12=1843200)
  68   2                      fx=fx*(REG2*65536+REG1*256+REG0);
  69   2                      sprintf(str_buff,"%-8.3fHz",fx);
  70   2                      lcd_put_xys(1,2,"               ");     //清屏
  71   2                      lcd_put_xys(1,2,"f=");  
  72   2                      lcd_put_xys(3,2,str_buff);      
  73   2                      delay_ms(1000);
  74   2              }
  75   1      }
  76          
  77          void timer0_int(void) interrupt 1
  78          {
  79   1              counter++;
  80   1      }


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


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

⌨️ 快捷键说明

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