C51 COMPILER V8.02   MAIN                                                                  07/23/2018 09:53:48 PAGE 1   


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

line level    source

   1          
   2          #define         uCHAR   unsigned char
   3          #define         uINT    unsigned int
   4          
   5          #include "REG_MA82G5Dxx.H"
   6          #include "delay.H"
   7          
   8          
   9          uCHAR flag_Tx0_Busy;
  10          
  11          
  12          
  13          void INT_UART0(void) interrupt 4
  14          {
  15   1      
  16   1              if(RI0){
  17   2                      RI0 = 0;
  18   2                      
  19   2              }else if(TI0)
  20   1              {
  21   2                      TI0 = 0;
  22   2                      if(flag_Tx0_Busy == 1)
  23   2                              flag_Tx0_Busy = 0;
  24   2              }
  25   1      }
  26          
  27          
  28          void Initial_UART0(void)
  29          {
  30   1              //SMOD = 1
  31   1              PCON0=PCON0|0x80;
  32   1          //串口模式为1: 10位可变波特率,使能接收
  33   1          S0CON=0x50;
  34   1          //串口时钟来源为定时器1
  35   1              SFRPI=1;
  36   1              T2MOD1=T2MOD1&(~TL2IS);          // 选择访问TCLK/RCLK
  37   1              SFRPI=0;
  38   1              TCLK_TL2IE=0;
  39   1              RCLK_TF2L=0;
  40   1      
  41   1              S0CFG=0x08;
  42   1          //T0:1: 16位定时器 T1: 2: 8位自动重载定时器
  43   1          TMOD = 0x21;
  44   1              AUXR2=AUXR2|T1X12;               // T1为1T 模式
  45   1              //串口波特率为9600@11.0592MHz 1T
  46   1              TH1=0xB8;                        
  47   1              //使能定时器1
  48   1              TR1=1;
  49   1      }
  50          
  51          void UART0_Send_Byte(uCHAR dta)
  52          {
  53   1              S0BUF = dta;
  54   1              flag_Tx0_Busy = 1;
  55   1              while(flag_Tx0_Busy);
C51 COMPILER V8.02   MAIN                                                                  07/23/2018 09:53:48 PAGE 2   

  56   1      }
  57          
  58          void main(void)
  59          {    
  60   1              
  61   1              CKCON0 |= AFS;                                          //MCU Run 11.0592MHz,
  62   1              delay_ms(3);
  63   1              Initial_UART0();
  64   1              ES0 = 1;
  65   1              EA = 1;
  66   1              
  67   1              UART0_Send_Byte(0xAA);
  68   1              while(1);
  69   1      }


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


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