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

📄 uartprintf.lst

📁 ADUC845通过串口每隔1s向主机超级终端打印一个递增的十六进制数
💻 LST
字号:
C51 COMPILER V8.08   UARTPRINTF                                                            08/22/2007 22:14:36 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE UARTPRINTF
OBJECT MODULE PLACED IN uartPrintf.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE uartPrintf.c BROWSE

line level    source

   1                                                                                                                                                                                                          //********************************************************************
   2          //
   3          // Author        : ADI - Apps            www.analog.com/MicroConverter
   4          //
   5          // Date          : 16 October 2003
   6          //
   7          // File          : 847uart.c
   8          //
   9          // Hardware      : ADuC845, ADuC847, ADuC848 (taking into account fact that the ADuC848 is a 16-bit ADC)
  10          //
  11          // Description   : sample program that performs ADC conversions in
  12          //                 continuous mode and sends results to a PC via the
  13          //                 UART. Operates on the RTD (PT100) on the eval board
  14          //                                 via Ain1->Ain2 ADC inputs. The switches (S4) on the
  15          //                                 eval board must be set as follows to get this program
  16          //                                 working correctly...RTD AIN1, RTD AIN2, RTD REFIN+
  17          //                                 and RTD REFIN- must be set to ON. All other switches
  18          //                                 must be off.
  19          //********************************************************************
  20          
  21          #include <stdio.h>
  22          #include <ADuC845.h>    //To use this with an ADuC847 or ADuC848, simply change the
  23                                                      //header file to <ADuC847.h> or <ADuC848>
  24          unsigned  char   test_data;
  25          void TIC_int () interrupt 10
  26          {       //      EA=1;
  27   1                      test_data=test_data+1;
  28   1                      printf("\n");
  29   1              printf("%bX",test_data);
  30   1      }
  31          
  32          void delay(int length)
  33          {
  34   1      while (length >=0)
  35   1          length--;
  36   1      }
  37             
  38          void main (void)
  39          {
  40   1      
  41   1          T3CON = 0x83;       //9600 Baud rate
  42   1          T3FD = 0x12;
  43   1          SCON = 0x52;
  44   1      
  45   1      
  46   1              IEIP2 = 0x04;           //Enable TIC interrupt
  47   1              EA = 1;                 //Enable global interrupts
  48   1              TIMECON = 0xD0;         //Count in seconds
  49   1              INTVAL =  0x01;         //Count duration (5 second delay between temperature readings)
  50   1              delay(10000);           //Delay to allow TIC registers be written
  51   1                                      //Since TIC operates from 32.768kHz time must be given
  52   1                                      //to ensure the TIC registers are written to correctly.
  53   1              
  54   1          TIMECON     = 0xD3;         //Start counting, enable INTVAL counter & TIC counter
  55   1              
C51 COMPILER V8.08   UARTPRINTF                                                            08/22/2007 22:14:36 PAGE 2   

  56   1               while(1);
  57   1      }
  58          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    127    ----
   CONSTANT SIZE    =      6    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      1    ----
   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 + -