一个51单片机下编写红外遥控接收程序

源代码在线查看: com.lst

软件大小: 35 K
上传用户: BEIJINGHUANYING
关键词: 51单片机 编写 红外遥控 接收程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				C51 COMPILER V8.01   COM                                                                   06/07/2007 20:33:13 PAGE 1   
				
				
				C51 COMPILER V8.01, COMPILATION OF MODULE COM
				OBJECT MODULE PLACED IN .\output\COM.obj
				COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE COM\COM.c BROWSE DEBUG OBJECTEXTEND PRINT(.\list\COM.lst) OBJECT(.\output\C
				                    -OM.obj)
				
				line level    source
				
				   1          
				   2          #include  "headfiles\headfiles.h"
				   3          
				   4          struct baudStaff
				   5          {
				   6               char t1;
				   7               char pcon;
				   8          };
				   9          
				  10          
				  11          //Crystal Freq  =  18.432MHz
				  12          
				  13          struct baudStaff code baudList[] =
				  14          {
				  15              {0xff,0x80}, /*0   1152000*/
				  16              {0xfe,0x80}, /*1    576000*/
				  17              {0xfd,0x80}, /*2    288000*/
				  18              {0xfc,0x80}, /*3    144000*/
				  19              {0xf6,0x80}, /*4    115200*/
				  20              {0xec,0x80}, /*5     57600*/
				  21              {0xe2,0x80}, /*6     38400*/
				  22              {0xd8,0x80}, /*7     28800*/
				  23              {0xc4,0x80}, /*8     19200*/
				  24              {0x88,0x80}  /*9      9600*/
				  25          };
				  26          
				  27          void RandT(void) interrupt 4
				  28          {
				  29   1        unsigned char tmp;
				  30   1         if(TI)
				  31   1         {
				  32   2            TI=0;
				  33   2            return;
				  34   2         }
				  35   1         if(RI)
				  36   1         {
				  37   2             RI=0;
				  38   2             tmp = SBUF;
				  39   2        //     P1 = tmp;
				  40   2             SBUF = tmp;
				  41   2         }
				  42   1      }
				  43          
				  44          void SetCom(char baudNum)
				  45          {
				  46   1            SCON = 0x50;
				  47   1            PCON = baudList[baudNum].pcon;
				  48   1            REN  = 1;
				  49   1            TMOD = 0x21;
				  50   1            TH1  = baudList[baudNum].t1;
				  51   1                TL1  = baudList[baudNum].t1;
				  52   1            AUXR = AUXR|0x40;
				  53   1            TR1  = 1;
				  54   1            ES   = 1;
				C51 COMPILER V8.01   COM                                                                   06/07/2007 20:33:13 PAGE 2   
				
				  55   1            EA   = 1;
				  56   1      }
				  57          
				  58          
				  59          
				  60          void Send_Str(unsigned char *str)
				  61          {
				  62   1         while(*str!= '\0')
				  63   1           {
				  64   2                  SBUF = *str;
				  65   2                      str++;
				  66   2                      Delay(30);
				  67   2               }
				  68   1      }
				  69          
				  70          
				  71          void Send_HEX_char(unsigned char ch)
				  72          {
				  73   1          unsigned  char tmp;
				  74   1              tmp = ((ch&0xF0)>>4);
				  75   1              if(tmp				  76   1               {
				  77   2                 SBUF = tmp+48;
				  78   2               }
				  79   1              else
				  80   1               {
				  81   2                 SBUF = tmp+55;
				  82   2               }
				  83   1              Delay(30);
				  84   1              tmp = ch&0x0F;
				  85   1              if(tmp				  86   1               {
				  87   2                 SBUF = tmp+48;
				  88   2               }
				  89   1              else
				  90   1               {
				  91   2                 SBUF = tmp+55;
				  92   2               }
				  93   1              Delay(30);
				  94   1      }
				  95          
				
				
				MODULE INFORMATION:   STATIC OVERLAYABLE
				   CODE SIZE        =    192    ----
				   CONSTANT SIZE    =     20    ----
				   XDATA SIZE       =   ----    ----
				   PDATA SIZE       =   ----    ----
				   DATA SIZE        =   ----       4
				   IDATA SIZE       =   ----    ----
				   BIT SIZE         =   ----    ----
				END OF MODULE INFORMATION.
				
				
				C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
							

相关资源