m0e 3 years ago
commit
9a321ec95e
100 changed files with 14887 additions and 0 deletions
  1. BIN
      Black board T5Ф-АнНј.pdf
  2. BIN
      Black board T5Ф-АнНј.sch
  3. 9 0
      ESP_8266/ABSTRACT.TXT
  4. 123 0
      ESP_8266/AI_CLOUD.LST
  5. BIN
      ESP_8266/AI_CLOUD.OBJ
  6. BIN
      ESP_8266/ASK
  7. 1057 0
      ESP_8266/ASK.M51
  8. 275 0
      ESP_8266/ASK.hex
  9. 10 0
      ESP_8266/ASK.lnp
  10. 9 0
      ESP_8266/ASK.plg
  11. 1782 0
      ESP_8266/ASK.uvopt
  12. 395 0
      ESP_8266/ASK.uvproj
  13. 160 0
      ESP_8266/ASK.w
  14. 1782 0
      ESP_8266/ASK_uvopt.bak
  15. 390 0
      ESP_8266/ASK_uvproj.bak
  16. 50 0
      ESP_8266/AT_PRC.H
  17. 138 0
      ESP_8266/AT_PRC.LST
  18. BIN
      ESP_8266/AT_PRC.OBJ
  19. 109 0
      ESP_8266/AT_PRC.c
  20. 51 0
      ESP_8266/CRC16.C
  21. 4 0
      ESP_8266/CRC16.H
  22. 77 0
      ESP_8266/CRC16.LST
  23. BIN
      ESP_8266/CRC16.OBJ
  24. 131 0
      ESP_8266/CRC16CCIT.C
  25. 15 0
      ESP_8266/DELAY.C
  26. 3 0
      ESP_8266/DELAY.H
  27. 38 0
      ESP_8266/DELAY.LST
  28. BIN
      ESP_8266/DELAY.OBJ
  29. 67 0
      ESP_8266/DHT11.C
  30. 92 0
      ESP_8266/DHT11.LST
  31. BIN
      ESP_8266/DHT11.OBJ
  32. 4 0
      ESP_8266/EEPROM.C
  33. 27 0
      ESP_8266/EEPROM.LST
  34. BIN
      ESP_8266/EEPROM.OBJ
  35. 40 0
      ESP_8266/EPROM.C
  36. 27 0
      ESP_8266/EPROM.H
  37. 63 0
      ESP_8266/EPROM.LST
  38. BIN
      ESP_8266/EPROM.OBJ
  39. BIN
      ESP_8266/HELLO
  40. 173 0
      ESP_8266/HELLO.LST
  41. 253 0
      ESP_8266/HELLO.M51
  42. BIN
      ESP_8266/HELLO.OBJ
  43. 3 0
      ESP_8266/HELLO.lnp
  44. 16 0
      ESP_8266/HELLO.plg
  45. 124 0
      ESP_8266/Hello.UV2.bak
  46. 45 0
      ESP_8266/Hello.opt.bak
  47. 1661 0
      ESP_8266/Hello.uvopt
  48. 1661 0
      ESP_8266/Hello_uvopt.bak
  49. 370 0
      ESP_8266/Hello_uvproj.bak
  50. 373 0
      ESP_8266/MAIN.C
  51. 427 0
      ESP_8266/MAIN.LST
  52. BIN
      ESP_8266/MAIN.OBJ
  53. 265 0
      ESP_8266/PWM.C
  54. 296 0
      ESP_8266/PWM.LST
  55. BIN
      ESP_8266/PWM.OBJ
  56. 91 0
      ESP_8266/PWM3
  57. 70 0
      ESP_8266/PWM3.C
  58. 95 0
      ESP_8266/PWM3.LST
  59. BIN
      ESP_8266/PWM3.OBJ
  60. 198 0
      ESP_8266/STARTUP.A51
  61. 252 0
      ESP_8266/STARTUP.LST
  62. BIN
      ESP_8266/STARTUP.OBJ
  63. 852 0
      ESP_8266/STC15Fxxxx.H
  64. 126 0
      ESP_8266/SYS.H
  65. 83 0
      ESP_8266/TIMER0.C
  66. 108 0
      ESP_8266/TIMER0.LST
  67. BIN
      ESP_8266/TIMER0.OBJ
  68. 22 0
      ESP_8266/UART.C
  69. 89 0
      ESP_8266/UART.H
  70. 45 0
      ESP_8266/UART.LST
  71. BIN
      ESP_8266/UART.OBJ
  72. 0 0
      ESP_8266/main.H
  73. 5 0
      LINKS.TXT
  74. 1 0
      README.md
  75. BIN
      STC15-English.pdf
  76. 9 0
      SmartHome/.classpath
  77. 33 0
      SmartHome/.project
  78. 3 0
      SmartHome/.settings/org.eclipse.core.resources.prefs
  79. 105 0
      SmartHome/AndroidManifest.xml
  80. BIN
      SmartHome/Thumbs.db
  81. 105 0
      SmartHome/bin/AndroidManifest.xml
  82. BIN
      SmartHome/bin/SmartHome.apk
  83. BIN
      SmartHome/bin/classes.dex
  84. BIN
      SmartHome/bin/classes/com/demo/smarthome/BuildConfig.class
  85. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$attr.class
  86. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$color.class
  87. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$dimen.class
  88. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$drawable.class
  89. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$id.class
  90. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$layout.class
  91. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$menu.class
  92. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$raw.class
  93. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$string.class
  94. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$style.class
  95. BIN
      SmartHome/bin/classes/com/demo/smarthome/R$styleable.class
  96. BIN
      SmartHome/bin/classes/com/demo/smarthome/R.class
  97. BIN
      SmartHome/bin/classes/com/demo/smarthome/activity/DevViewActivity$1.class
  98. BIN
      SmartHome/bin/classes/com/demo/smarthome/activity/DevViewActivity$2.class
  99. BIN
      SmartHome/bin/classes/com/demo/smarthome/activity/DevViewActivity$3.class
  100. 0 0
      SmartHome/bin/classes/com/demo/smarthome/activity/DevViewActivity$4.class

BIN
Black board T5Ф-АнНј.pdf


BIN
Black board T5Ф-АнНј.sch


+ 9 - 0
ESP_8266/ABSTRACT.TXT

@@ -0,0 +1,9 @@
+The HELLO program is a very simple program that prints "Hello World"
+to the serial port of the 8051.  When you can successfully build and
+run this program, you have used the entire toolset including:
+
+The uVision integrated development environment.
+The C51 compiler, linker and the uVision simulator/debugger.
+
+The ASM program is available in one target:
+  Simulator:    uses the uVision simulator for testing

+ 123 - 0
ESP_8266/AI_CLOUD.LST

@@ -0,0 +1,123 @@
+C51 COMPILER V9.01   AI_CLOUD                                                              05/16/2015 12:58:19 PAGE 1   
+
+
+C51 COMPILER V9.01, COMPILATION OF MODULE AI_CLOUD
+OBJECT MODULE PLACED IN AI_CLOUD.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE AI_CLOUD.C COMPACT OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #include "AI_CLOUD.H"
+   2          void make_send_pack(unsigned char ms_opt,unsigned char *dev_id,unsigned char *toke_id,unsigned char *use_d
+             -ata,unsigned char use_data_len)
+   3          {
+   4   1        unsigned char a,b,i=0;
+   5   1        unsigned esp_crc=0;
+   6   1        send_buf[0]=0x55;                                                  //包头是0X55固定
+   7   1        
+   8   1        send_buf[O_LEN_L]=(O_DATAS_START+use_data_len+3)%0xff; //ݰݳȣͷβǵûо
+             -תǰİ
+   9   1        send_buf[O_LEN_H]=(O_DATAS_START+use_data_len+3)/0xff;
+  10   1      
+  11   1        if((ms_opt==0)||(ms_opt==2))                                                                                   //根据入口参数判断是发送登录链路操作,还是发送数据包云平台
+  12   1        send_buf[O_CMD_T]=0XA0;// 0XA0 链路操作 0XAA 数据传输 0XAC 实时检测指令 0XF0 终端操作 
+  13   1        else if (ms_opt==1)
+  14   1        send_buf[O_CMD_T]=0XAA;// 0XA0 链路操作 0XAA 数据传输 0XAC 实时检测指令 0XF0 终端操作
+  15   1         
+  16   1      
+  17   1        if(ms_opt==0)                                                         //0X00代表登录操作
+  18   1        send_buf[O_CMD_C]=0X00;// reg  option
+  19   1        else if (ms_opt==1)
+  20   1        send_buf[O_CMD_C]=0XEE;       
+  21   1        else if(ms_opt==2)
+  22   1        send_buf[O_CMD_C]=0X01;                                           //0XEE代表数据是从设备到云平台的方向
+  23   1      
+  24   1        send_buf[O_CIX_L]=0XF3;// CMD INDEXL                  //бţʱãΪԷӦݰ
+             -űʾ
+  25   1        send_buf[O_CIX_H]=0XC0;//     CMD INDEXL                                      //命令序列编号,暂时不用,可以作为对方应答的数据包号标示
+  26   1        send_buf[O_EXMSH]=0XC0;//     EXTERN MESSAGE1                         //扩展子暂时保留
+  27   1        send_buf[O_EXMSL]=0XF3;//     EXTERN MESSAGE2                         //扩展子暂时保留
+  28   1      
+  29   1        send_buf[O_RESTA]=0X02;//     CMD_STA 00 OK 01 FAIL 02 SEND 03 NO SUP  //ݰ״̬ǷͻӦ
+             -ɹʧ
+  30   1      
+  31   1        for(i=0;i<8;i++)
+  32   1        send_buf[O_DEVID+i]=*(dev_id+(7-i)); // 拷贝设备的唯一ID号到数据包里
+  33   1      
+  34   1      
+  35   1        send_buf[O_TK_LEN] =8;                   //代表接下来的令牌包是8个字节
+  36   1      
+  37   1      
+  38   1        for(i=0;i<8;i++)
+  39   1        send_buf[O_TOKE_START+i]=*(toke_id+i);//8个字节令牌包,初始令牌包为00 后续服务器会分配一个令牌包给这个设
+             -备,设备每次通讯要携带这个令牌包
+  40   1      
+  41   1      
+  42   1        for(i=0;i<use_data_len;i++)
+  43   1        send_buf[O_DATAS_START+i]=*(use_data+i); // 客户的数据区,登录的时候放数据密码文本
+  44   1        
+  45   1        temp_buf[0]=0x55;                                                //包尾
+  46   1      
+  47   1        esp_crc=GetRevCrc_16(send_buf,O_DATAS_START+use_data_len);//得到转义之前的总数据包CRC,具体可以参照CRC数
+             -据格式,因此CRC是针对转义之前的数据生成
+  48   1      
+  49   1        for(a=1,b=1;a<(O_DATAS_START+use_data_len);a++)           //将出去包头,所有的数据中含有有0X55的数据转义
+C51 COMPILER V9.01   AI_CLOUD                                                              05/16/2015 12:58:19 PAGE 2   
+
+             -成0X54,0X01,将0X54 变成0X54,02,重新转义数据包
+  50   1        {
+  51   2          if(send_buf[a]==0x55)
+  52   2              {
+  53   3                temp_buf[b]=0x54;
+  54   3                b+=1;
+  55   3                temp_buf[b]=0x01;
+  56   3                b+=1;
+  57   3              }
+  58   2              else if(send_buf[a]==0x54)
+  59   2              {
+  60   3                temp_buf[b]=0x54;
+  61   3                b+=1;
+  62   3                temp_buf[b]=0x02;
+  63   3                b+=1;
+  64   3              }
+  65   2              else
+  66   2              {
+  67   3              temp_buf[b]=send_buf[a];
+  68   3              b+=1;
+  69   3              }
+  70   2       }       ///////////////////////////////////////////////////////////以上的语句转义数据包中除包头到CRC之前的全部
+             -的数据///////////////////////////////////////////////////////////////////////
+  71   1       //55 28 00 AA EE F3 C0 C0 F3 02 E6 1E 00 00 00 00 00 00 08 24 41 D6 39 48 83 AC 00 54 02 45 4D 50 3A 32 3
+             -5 35 3B 00 D1 52 55
+  72   1       //55 28 00 AA EE F3 C0 C0 F3 02 E6 1E 00 00 00 00 00 00 08 24 41 D6 39 48 83 AC 00 54 02 45 4D 50 3A 32 3
+             -5 35 3B 00 D1 52 55
+  73   1      
+  74   1       temp_buf[b]=(esp_crc>>8);
+  75   1       b+=1;
+  76   1       temp_buf[b]=(esp_crc&0x00ff);   
+  77   1       b+=1;
+  78   1          ///////////////////////////////////////////////////////////上面两句加上CRC校验////////////////////////
+             -////////////////
+  79   1       temp_buf[b]=0x55;      //包尾
+  80   1       b+=1;
+  81   1       temp_buf[b]=0x0d;
+  82   1       b+=1;
+  83   1       temp_buf[b]=0x0a;
+  84   1       b+=1;                          //以上构成回车
+  85   1       need_seed_len=b;       //至此构造出了需要发送的全部数据 包括AT指令需要的换行
+  86   1       temp_buf[b]=0x00;
+  87   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =    486    ----
+   CONSTANT SIZE    =   ----    ----
+   XDATA SIZE       =   ----    ----
+   PDATA SIZE       =   ----      14
+   DATA SIZE        =   ----    ----
+   IDATA SIZE       =   ----    ----
+   BIT SIZE         =   ----    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

BIN
ESP_8266/AI_CLOUD.OBJ


BIN
ESP_8266/ASK


File diff suppressed because it is too large
+ 1057 - 0
ESP_8266/ASK.M51


+ 275 - 0
ESP_8266/ASK.hex

@@ -0,0 +1,275 @@
+:03000000020B6789
+:0C0B6700787FE4F6D8FD758182020BAEA9
+:10054E0041542B434C4453454E443D3130004154AD
+:10055E002B434C4453544152540041542B434C446E
+:10056E00554E42494E440041542B5253540041546F
+:10057E002B43574D4F44453D310041542B43574A71
+:10058E0041503D223336307765222C227A747930F1
+:10059E00303132303031220041542B4349505354C4
+:1005AE004152543D332C22554450222C22636C6F01
+:1005BE0075642E61692D7468696E6B65722E636F3A
+:1005CE006D222C353030312C323436382C300052EE
+:1005DE0050543A2230786131623233343637222C1D
+:1005EE002230786166333231323334222C22313963
+:1005FE00322E3136382E302E313233222C226C6987
+:10060E00676874222C223132333435366122004130
+:10061E00542B4349504D55583D310041542B4349BD
+:10062E005053544152543D342C22554450222C22C6
+:10063E00636C6F75642E61692D7468696E6B65727B
+:10064E002E636F6D222C353030312C323436382CEF
+:10065E00300041542B4353595349440041542B43CA
+:10066E0057534D41525453544152543D310041540D
+:10067E002B4C414E535441525400303030303030B8
+:10068E00303030303030303030303030303030305C
+:10069E003030303030303030303030303100415446
+:1006AE002B43495053454E443D342C0041542B436B
+:1006BE00495053454E443D332C3633004C49474840
+:1006CE00543A313B004C494748543A303B0032349F
+:1006DE0036392C30002B4353595349443A43484939
+:1006EE0050002B4950442C004C494748543A004C7A
+:1006FE0049474854523A004C49474854473A004CEF
+:10070E0049474854423A002B4950442C342C323637
+:10071E003A52504C3A005749464920474F54004CE4
+:10072E0049474854523A004C49474854473A004CBE
+:07073E0049474854423A000C
+:10091600C107C10441003100C10141000800410086
+:10092600041041000A0B4100413A41003E00C1005B
+:10093600C10341000500204043551E00A000F3C03E
+:1009460000000054019FA600000000000800CC54DF
+:10095600393A66AA1CB6C555000000000000000022
+:100966000000000000000000000000000000000081
+:100976000000000000000000004A003254454D50BF
+:100986003A3132333B0041000D00C10542000B00F5
+:1009960000C106C108C10901100041003F00410025
+:1009A60000014100010041004200410040004100B9
+:0F09B60009004100070041000600420002000056
+:100F3600E4FF7F407843E4F608DFFCE490003CF0F1
+:100F4600D20C90005AF0C20AF9900022C9F0A3F020
+:030F5600A3E9F01C
+:010F59002275
+:100CE600301070C21090000D7409F07D01FF120AD9
+:100CF600B47B017A00790E120D5A7FE87E037D00DF
+:100D06007C00120E4A7B017A00793290000DE0FDDC
+:100D1600120DFFC291D2B47FC87E007D007C001206
+:100D26000E4AD291C2B4120745900053E0FD75F009
+:100D36006484E5F075F00A842430900037F0ED7590
+:100D4600F00A84E5F02430A3F0900054E0243090BB
+:040D56000039F0224E
+:10083200E4FEFD7E0C900025E4F0A3DEFCE4FEEF76
+:10084200B40114EE90072D93FC74252EF582E43446
+:1008520000F583ECF0802EEFB40214EE900735938E
+:10086200FC74252EF582E43400F583ECF08016EF5B
+:10087200B40312EE90073D93FC74252EF582E43406
+:1008820000F583ECF00EEEB407B5EFB4010790006B
+:1008920001E0FD8014EFB40207900042E0FD800900
+:1008A200EFB40305900040E0FDEDC3940A4025ED4E
+:1008B20075F00A84243090002CF0ED75F00A84E57E
+:1008C200F02430A3F0A3740DF0A3740AF090000D8D
+:1008D20004F08013ED243090002CF0A3740DF0A3EB
+:1008E200740AF090000DF090000DE0FF7D01120AF5
+:1008F200B47B017A00790E120D5A7F327E007D00A0
+:100902007C00120E4A7B017A00792590000DE0FDF1
+:03091200120DFFC4
+:0109150022BF
+:10002600E4900043F0A3F0A3F0C2CC120E92C2B447
+:100036007FE87E037D007C00120E4A900001E0906E
+:100046000009F0900042E0900007F0900040E09038
+:100056000006F07B017D017F01120ED512000E20F5
+:100066009315C291D2B47FC87E007D007C00120E2B
+:100076004AD291C2B4D2007BFF7A05797C120D5A1E
+:100086007FF47E017D007C00120E4A120F3630008E
+:10009600147BFF7A06796A120D5A7FF47E017D0081
+:1000A6007C00120E4AD2B47FF47E017D007C0012E1
+:1000B6000E4AC2B47FF47E017D007C00120E4A9087
+:1000C600004974FFF0A37407F0A37424F07B007A50
+:1000D6000079431209F5E94A4B60CAC20A7BFF7AE6
+:1000E60005795C120D5A7FE87E037D007C00120EB6
+:1000F6004A7BFF7A06797C120D5A7FF47E017D00D9
+:100106007C00120E4A200E0302026AC20E209310D1
+:10011600900003E004F07006900002E004F080070F
+:10012600E4900002F0A3F0D3900003E094F4900072
+:1001360002E094014050E4F0A3F07BFF7A05796871
+:10014600120D5AD2B47F647E007D007C00120E4AE6
+:10015600C2B47F647E007D007C00120E4AD2B47F5A
+:10016600647E007D007C00120E4AC2B47F647E006D
+:100176007D007C00120E4AD2B47F647E007D007C36
+:1001860000120E4AC2B4900009E0FF900001E0D3CD
+:100196009F4017900009E004F0E0FF900007E0FDA3
+:1001A600900006E0FB120F5A8022900009E0FF90B3
+:1001B6000001E0C39F5015900009E014F0E0FF90A5
+:1001C6000007E0FD900006E0FB120F5A900007E0E2
+:1001D600FF900042E0D39F401A900007E004F090A1
+:1001E6000009E0FF900007E0FD900006E0FB120F1B
+:1001F6005A8025900007E0FF900042E0C39F501808
+:10020600900007E014F0900009E0FF900007E0FD81
+:10021600900006E0FB120F5A900006E0FF900040A7
+:10022600E0D39F401A900006E004F0900009E0FF3A
+:10023600900007E0FD900006E0FB120F5A80259023
+:100246000006E0FF900040E0C39F5018900006E0D3
+:1002560014F0900009E0FF900007E0FD900006E032
+:10026600FB120F5A200A0302054790004974FFF05B
+:10027600A37406F0A374F6F07B007A0079431209A2
+:10028600F5900022EBF0A3EAF0A3E9F04A4B7003E5
+:100296000203B0900022E0FBA3E0FAA3E0F990008D
+:1002A60006120C0C64307072C2B390000D7408F024
+:1002B6007D01FF120AB47B017A00790E120D5A7F76
+:1002C600327E007D007C00120E4A7BFF7A0679D3CF
+:1002D60090000DE0FD120DFF7F147E007D007C0076
+:1002E600120E4AE4900001F0900042F0900040F0B7
+:1002F6007F011208327F011208327F021208327F14
+:10030600327E007D007C00120E4A7F031208327F87
+:10031600327E007D007C00120E4A900022E0FBA394
+:10032600E0FAA3E0F9900006120C0C64317073D267
+:10033600B390000D7408F07D01FF120AB47B017AB8
+:1003460000790E120D5A7F147E007D007C00120E7D
+:100356004A7BFF7A0679CA90000DE0FD120DFF7FF9
+:10036600327E007D007C00120E4A9000017463F01C
+:10037600900042F0900040F07F011208327F011297
+:1003860008327F021208327F327E007D007C001226
+:100396000E4A7F031208327F327E007D007C0012F7
+:1003A6000E4A120F36C20A02054290004974FFF047
+:1003B600A37406F0A374FDF07B007A00794312095A
+:1003C600F5900022EBF0A3EAF0A3E9F04A4B606156
+:1003D600900001E0FF900009E06F7055EFF090008B
+:1003E60022E0FBA3E0FAA3E0F9900008120C0CFF50
+:1003F6006003B40D0E900007120C0C24D09000017F
+:10040600F08026900009120C0CFF6003B40D1A90C0
+:100416000007120C0C24D075F00AA4FF90000812F5
+:100426000C0C24D02F900001F07F01120832020537
+:100436004290004974FFF0A37407F0A37405F07BA3
+:10044600007A0079431209F5900022EBF0A3EAF056
+:10045600A3E9F04A4B6061900042E0FF900007E09C
+:100466006F7055EFF0900022E0FBA3E0FAA3E0F9ED
+:10047600900008120C0CFF6003B40D0E90000712DA
+:100486000C0C24D0900042F08026900009120C0C2F
+:10049600FF6003B40D1A900007120C0C24D075F0FF
+:1004A6000AA4FF900008120C0C24D02F900042F0F2
+:1004B6007F0212083202054290004974FFF0A374CD
+:1004C60007F0A3740DF07B007A0079431209F590CA
+:1004D6000022EBF0A3EAF0A3E9F04A4B605E90003D
+:1004E60040E0FF900006E06F7052EFF0900022E0CF
+:1004F600FBA3E0FAA3E0F9900008120C0CFF6003DE
+:10050600B40D0E900007120C0C24D0900040F08021
+:1005160026900009120C0CFF6003B40D1A90000718
+:10052600120C0C24D075F00AA4FF900008120C0CD3
+:1005360024D02F900040F07F03120832120F36C2EB
+:070546000A120CE602010B92
+:01054D00228B
+:0C09C500C10DC10B41005A00C10CC10A59
+:03002300020DB417
+:100DB400C0E0C083C082C0D075D000C000C007307E
+:100DC4009825C298D20C90005AE4F0C20A90003CD4
+:100DD400E0FF2443F8A699EFC3943E5005E004F0E5
+:100DE400800590003CE4F0309904C299C202D00717
+:0B0DF400D000D0D0D082D083D0E032FD
+:100D5A00900046EBF0A3EAF0A3E9F0900046E0FB2E
+:100D6A00A3E0FAA3E0F9120BF3F599900047E475B2
+:100D7A00F001120C397F017E007D007C00120E4AC0
+:100D8A00900046E0FBA3E0FAA3E0F9120BF370CB64
+:100D9A0075990D7F01FEFDFC120E4A75990A7F01B5
+:090DAA007E007D007C00120E4A5F
+:010DB300221D
+:050DFF00900046EDF03C
+:100E0400A3EBF0A3EAF0A3E9F0900046E0602BA383
+:100E1400E0FBA3E0FAA3E0F9120BF3F59990004884
+:100E2400E475F001120C397F017E007D007C001214
+:100E34000E4A900046E014F080CF7F017E007D00D2
+:050E44007C00120E4AC3
+:010E49002286
+:100E9200C202E490003CF090003DF0E598543F44DB
+:100EA20040F59853A23F538EEF438E01438E047553
+:100EB200D6FF75D7D0438E10D29CD2ACD2AFD2BC63
+:100EC200E4F5B175B2FF90003CF0E5A2543F444016
+:030ED200F5A22264
+:100AB400E4FE7E1490000EE4F0A3DEFCE4FEED7090
+:100AC40014EE9006AC93FC740E2EF582E43400F51B
+:100AD40083ECF08016EDB40112EE90054E93FC7495
+:100AE4000E2EF582E43400F583ECF00EEEB40BCE5A
+:100AF400C205EF75F06484FD60122430FD740E2E7F
+:100B0400F582E43400F583EDF00ED205EF75F06460
+:100B140084E5F075F00A84FD60142430FD740E2E13
+:100B2400F582E43400F583EDF00ED2058011300532
+:100B34000E740E2EF582E43400F5837430F00EEF5B
+:100B440075F00A84E5F02430FF740E2EF582E43447
+:100B540000F583EFF00E740E2EF582E43400F58375
+:020B6400E4F0BB
+:010B6600226C
+:0F0F6B00E4FEEF600AE4FE0EEEB40EFB1F80F30F
+:010F7A002254
+:100E4A0090004A120C6590004AE0FCA3E0FDA3E082
+:100E5A00FEA3E0FFEC4D4E4F602D7FC8120F6B9042
+:100E6A00004AE0FCA3E0FDA3E0FEA3E0FF74FFEF6D
+:100E7A0024FFFFEE34FFFEED34FFFDEC34FFFC905F
+:080E8A00004A120C6580BF2232
+:100ED50043A22053A2EFE4F5D8F5E9F5F975D90257
+:100EE500F5F28FEA8FFA75DA42F5F3AF058FEB8FDE
+:100EF500FB75DB42F5F4AF038FEC8FFC75DC42D25A
+:020F0500DE22EA
+:100F5A008FEA8FFAAF058FEB8FFBAF038FEC8FFC15
+:010F6A002264
+:0F09D100C10F4200580000C11041005700C10E75
+:03000B00020C7173
+:100C7100C0E0C0F0C083C082C0D075D008900057DA
+:100C8100E0C3940A5005E004F08007900057E4F0B7
+:100C9100D20E900058E0FEA3E0FFE4FCFD7B607AF9
+:100CA100EAF9F8D3120C4F4010900059E004F070AB
+:100CB10006900058E004F08009D210900058E4F04A
+:100CC100A3F090005AE0C3940A5005E004F0800AB2
+:100CD100300C07200A04C20CD20AD0D0D082D083B3
+:050CE100D0F0D0E0326C
+:10000E00438E80C2B9E4F589758A9A758CA9D28C13
+:05001E00D2A9D2AF22BF
+:1009E00041005500410056004100530041005400B1
+:0409F0004100520070
+:100F0700E4900047F07F06120F6B30B5FDE49000C8
+:100F170047F030B50D7F01120F6B900047E004F0EA
+:0E0F270080F0900047E0D3940A4002D322C32A
+:010F35002299
+:10074500C2B57F147E007D007C00120E4AD2B57FB3
+:100755000A120F6B30B5FD7F06120F6B20B5FDE455
+:10076500900046F0120F07500B900055E0FF25E072
+:1007750004F08008900055E0FF25E0F0900046E089
+:1007850004F0E0C3940840DCE4900046F0120F0743
+:10079500500B900056E0FF25E004F08008900056CD
+:1007A500E0FF25E0F0900046E004F0E0C394084047
+:1007B500DCE4900046F0120F07500B900053E0FF69
+:1007C50025E004F08008900053E0FF25E0F090005C
+:1007D50046E004F0E0C3940840DCE4900046F012E3
+:1007E5000F07500B900054E0FF25E004F0800890BF
+:1007F5000054E0FF25E0F0900046E004F0E0C394EB
+:100805000840DCE4900046F0120F07500B900052B0
+:10081500E0FF25E004F08008900052E0FF25E0F0BD
+:0C082500900046E004F0E0C3940840DCC2
+:0108310022A4
+:100B7300020026E493A3F8E493A34003F68001F272
+:100B830008DFF48029E493A3F85407240CC8C33383
+:100B9300C4540F4420C8834004F456800146F6DF52
+:100BA300E4800B0102040810204080900916E47EC3
+:100BB300019360BCA3FF543F30E509541FFEE49347
+:100BC300A360010ECF54C025E060A840B8E493A30E
+:100BD300FAE493A3F8E493A3C8C582C8CAC583CA39
+:100BE300F0A3C8C582C8CAC583CADFE9DEE780BEF1
+:0109F4000002
+:100BF300BB010689828A83E0225002E722BBFE0200
+:090C0300E32289828A83E4932232
+:100C0C00BB010CE58229F582E5833AF583E022509D
+:100C1C0006E92582F8E622BBFE06E92582F8E222E7
+:0D0C2C00E58229F582E5833AF583E4932201
+:100C3900C5F0F8A3E028F0C5F0F8E5821582700246
+:060C49001583E038F022E3
+:100C4F00EB9FF5F0EA9E42F0E99D42F0EC6480C81C
+:060C5F0064809845F022BC
+:0C0C6500ECF0A3EDF0A3EEF0A3EFF02202
+:1009F500900046EBF0A3EAF0A3E9F0A3E0FBA3E047
+:100A0500FAA3E0F9120BF37003020AA1900046E085
+:100A1500FBA3E0FAA3E0F9120BF37003020AAD9011
+:100A25000049E0F9A3E0FAA3E0A3C9F0A3EAF0A323
+:100A3500E9F0900046A3E0FAA3E0F990004FEBF04F
+:100A4500A3EAF0A3E9F090004CE0FBA3E0FAA3E0F1
+:100A5500F9120BF3FF602690004FE0FBA3E0FAA329
+:100A6500E0F9120BF36F701590004D75F001120C43
+:100A750039900050E475F001120C3980C990004C92
+:100A8500E0FBA3E0FAA3E0F9120BF37002800D90EE
+:100A95000047E475F001120C39020A11900046E096
+:0F0AA500FBA3E0FAA3E0F9227B007A007900229C
+:00000001FF

+ 10 - 0
ESP_8266/ASK.lnp

@@ -0,0 +1,10 @@
+"STARTUP.obj",
+"MAIN.obj",
+"UART.obj",
+"AT_PRC.obj",
+"DELAY.obj",
+"PWM3.obj",
+"TIMER0.obj",
+"DHT11.obj" 
+TO "ASK" 
+RAMSIZE(256) 

+ 9 - 0
ESP_8266/ASK.plg

@@ -0,0 +1,9 @@
+<html>
+<body>
+<pre>
+<h1>礦ision Build Log</h1>
+<h2>Project:</h2>
+C:\Users\Administrator\Desktop\ZN安信可\PCB和拼板文件\新款8266\大黑板\大黑板单片机程序1.1\ESP_8266\ASK.uvproj
+Project File Date:  07/19/2015
+
+<h2>Output:</h2>

File diff suppressed because it is too large
+ 1782 - 0
ESP_8266/ASK.uvopt


+ 395 - 0
ESP_8266/ASK.uvproj

@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
+
+  <SchemaVersion>1.0</SchemaVersion>
+
+  <Header>### uVision Project, (C) Keil Software</Header>
+
+  <Targets>
+    <Target>
+      <TargetName>Target 1</TargetName>
+      <ToolsetNumber>0x0</ToolsetNumber>
+      <ToolsetName>MCS-51</ToolsetName>
+      <TargetOption>
+        <TargetCommonOption>
+          <Device>SM89516A</Device>
+          <Vendor>SyncMOS</Vendor>
+          <Cpu>IRAM(0-0xFF) XRAM(0-0x2FF) IROM(0-0xFFFF) CLOCK(40000000)</Cpu>
+          <FlashUtilSpec></FlashUtilSpec>
+          <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
+          <FlashDriverDll></FlashDriverDll>
+          <DeviceId>3759</DeviceId>
+          <RegisterFile>SM89516A.H</RegisterFile>
+          <MemoryEnv></MemoryEnv>
+          <Cmp></Cmp>
+          <Asm></Asm>
+          <Linker></Linker>
+          <OHString></OHString>
+          <InfinionOptionDll></InfinionOptionDll>
+          <SLE66CMisc></SLE66CMisc>
+          <SLE66AMisc></SLE66AMisc>
+          <SLE66LinkerMisc></SLE66LinkerMisc>
+          <UseEnv>0</UseEnv>
+          <BinPath></BinPath>
+          <IncludePath></IncludePath>
+          <LibPath></LibPath>
+          <RegisterFilePath>SyncMOS\</RegisterFilePath>
+          <DBRegisterFilePath>SyncMOS\</DBRegisterFilePath>
+          <TargetStatus>
+            <Error>0</Error>
+            <ExitCodeStop>0</ExitCodeStop>
+            <ButtonStop>0</ButtonStop>
+            <NotGenerated>0</NotGenerated>
+            <InvalidFlash>1</InvalidFlash>
+          </TargetStatus>
+          <OutputDirectory>.\</OutputDirectory>
+          <OutputName>ASK</OutputName>
+          <CreateExecutable>1</CreateExecutable>
+          <CreateLib>0</CreateLib>
+          <CreateHexFile>1</CreateHexFile>
+          <DebugInformation>1</DebugInformation>
+          <BrowseInformation>1</BrowseInformation>
+          <ListingPath>.\</ListingPath>
+          <HexFormatSelection>0</HexFormatSelection>
+          <Merge32K>0</Merge32K>
+          <CreateBatchFile>0</CreateBatchFile>
+          <BeforeCompile>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </BeforeCompile>
+          <BeforeMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </BeforeMake>
+          <AfterMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </AfterMake>
+          <SelectedForBatchBuild>0</SelectedForBatchBuild>
+          <SVCSIdString></SVCSIdString>
+        </TargetCommonOption>
+        <CommonProperty>
+          <UseCPPCompiler>0</UseCPPCompiler>
+          <RVCTCodeConst>0</RVCTCodeConst>
+          <RVCTZI>0</RVCTZI>
+          <RVCTOtherData>0</RVCTOtherData>
+          <ModuleSelection>0</ModuleSelection>
+          <IncludeInBuild>1</IncludeInBuild>
+          <AlwaysBuild>0</AlwaysBuild>
+          <GenerateAssemblyFile>0</GenerateAssemblyFile>
+          <AssembleAssemblyFile>0</AssembleAssemblyFile>
+          <PublicsOnly>0</PublicsOnly>
+          <StopOnExitCode>3</StopOnExitCode>
+          <CustomArgument></CustomArgument>
+          <IncludeLibraryModules></IncludeLibraryModules>
+          <BankNo>65535</BankNo>
+        </CommonProperty>
+        <DllOption>
+          <SimDllName>S8051.DLL</SimDllName>
+          <SimDllArguments></SimDllArguments>
+          <SimDlgDll>DP51.DLL</SimDlgDll>
+          <SimDlgDllArguments>-p52</SimDlgDllArguments>
+          <TargetDllName>S8051.DLL</TargetDllName>
+          <TargetDllArguments></TargetDllArguments>
+          <TargetDlgDll>TP51.DLL</TargetDlgDll>
+          <TargetDlgDllArguments>-p52</TargetDlgDllArguments>
+        </DllOption>
+        <DebugOption>
+          <OPTHX>
+            <HexSelection>0</HexSelection>
+            <HexRangeLowAddress>0</HexRangeLowAddress>
+            <HexRangeHighAddress>0</HexRangeHighAddress>
+            <HexOffset>0</HexOffset>
+            <Oh166RecLen>16</Oh166RecLen>
+          </OPTHX>
+          <Simulator>
+            <UseSimulator>1</UseSimulator>
+            <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+            <RunToMain>1</RunToMain>
+            <RestoreBreakpoints>1</RestoreBreakpoints>
+            <RestoreWatchpoints>1</RestoreWatchpoints>
+            <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+            <RestoreFunctions>1</RestoreFunctions>
+            <RestoreToolbox>1</RestoreToolbox>
+            <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
+          </Simulator>
+          <Target>
+            <UseTarget>0</UseTarget>
+            <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+            <RunToMain>0</RunToMain>
+            <RestoreBreakpoints>1</RestoreBreakpoints>
+            <RestoreWatchpoints>1</RestoreWatchpoints>
+            <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+            <RestoreFunctions>0</RestoreFunctions>
+            <RestoreToolbox>1</RestoreToolbox>
+          </Target>
+          <RunDebugAfterBuild>0</RunDebugAfterBuild>
+          <TargetSelection>-1</TargetSelection>
+          <SimDlls>
+            <CpuDll></CpuDll>
+            <CpuDllArguments></CpuDllArguments>
+            <PeripheralDll></PeripheralDll>
+            <PeripheralDllArguments></PeripheralDllArguments>
+            <InitializationFile></InitializationFile>
+          </SimDlls>
+          <TargetDlls>
+            <CpuDll></CpuDll>
+            <CpuDllArguments></CpuDllArguments>
+            <PeripheralDll></PeripheralDll>
+            <PeripheralDllArguments></PeripheralDllArguments>
+            <InitializationFile></InitializationFile>
+            <Driver></Driver>
+          </TargetDlls>
+        </DebugOption>
+        <Utilities>
+          <Flash1>
+            <UseTargetDll>0</UseTargetDll>
+            <UseExternalTool>0</UseExternalTool>
+            <RunIndependent>0</RunIndependent>
+            <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
+            <Capability>0</Capability>
+            <DriverSelection>-1</DriverSelection>
+          </Flash1>
+          <Flash2></Flash2>
+          <Flash3></Flash3>
+          <Flash4></Flash4>
+        </Utilities>
+        <Target51>
+          <Target51Misc>
+            <MemoryModel>2</MemoryModel>
+            <RTOS>0</RTOS>
+            <RomSize>2</RomSize>
+            <DataHold>0</DataHold>
+            <XDataHold>0</XDataHold>
+            <UseOnchipRom>0</UseOnchipRom>
+            <UseOnchipArithmetic>0</UseOnchipArithmetic>
+            <UseMultipleDPTR>0</UseMultipleDPTR>
+            <UseOnchipXram>0</UseOnchipXram>
+            <HadIRAM>1</HadIRAM>
+            <HadXRAM>1</HadXRAM>
+            <HadIROM>1</HadIROM>
+            <Moda2>0</Moda2>
+            <Moddp2>0</Moddp2>
+            <Modp2>0</Modp2>
+            <Mod517dp>0</Mod517dp>
+            <Mod517au>0</Mod517au>
+            <Mode2>0</Mode2>
+            <useCB>0</useCB>
+            <useXB>0</useXB>
+            <useL251>0</useL251>
+            <useA251>0</useA251>
+            <Mx51>0</Mx51>
+            <ModC812>0</ModC812>
+            <ModCont>0</ModCont>
+            <Lp51>0</Lp51>
+            <useXBS>0</useXBS>
+            <ModDA>0</ModDA>
+            <ModAB2>0</ModAB2>
+            <Mx51P>0</Mx51P>
+            <hadXRAM2>0</hadXRAM2>
+            <uocXram2>0</uocXram2>
+            <ModC2>0</ModC2>
+            <ModH2>0</ModH2>
+            <Mdu_R515>0</Mdu_R515>
+            <Mdu_F120>0</Mdu_F120>
+            <Psoc>0</Psoc>
+            <hadIROM2>0</hadIROM2>
+            <ModSmx2>0</ModSmx2>
+            <cBanks>0</cBanks>
+            <xBanks>0</xBanks>
+            <OnChipMemories>
+              <RCB>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0xffff</Size>
+              </RCB>
+              <RXB>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </RXB>
+              <Ocm1>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm1>
+              <Ocm2>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm2>
+              <Ocm3>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm3>
+              <Ocr1>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr1>
+              <Ocr2>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr2>
+              <Ocr3>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr3>
+              <IRO>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x10000</Size>
+              </IRO>
+              <IRA>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x100</Size>
+              </IRA>
+              <XRA>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x300</Size>
+              </XRA>
+              <XRA512>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </XRA512>
+              <IROM512>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </IROM512>
+            </OnChipMemories>
+          </Target51Misc>
+          <C51>
+            <RegisterColoring>0</RegisterColoring>
+            <VariablesInOrder>0</VariablesInOrder>
+            <IntegerPromotion>1</IntegerPromotion>
+            <uAregs>0</uAregs>
+            <UseInterruptVector>1</UseInterruptVector>
+            <Fuzzy>3</Fuzzy>
+            <Optimize>6</Optimize>
+            <WarningLevel>2</WarningLevel>
+            <SizeSpeed>1</SizeSpeed>
+            <ObjectExtend>1</ObjectExtend>
+            <ACallAJmp>0</ACallAJmp>
+            <InterruptVectorAddress>0</InterruptVectorAddress>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define></Define>
+              <Undefine></Undefine>
+              <IncludePath></IncludePath>
+            </VariousControls>
+          </C51>
+          <Ax51>
+            <UseMpl>0</UseMpl>
+            <UseStandard>1</UseStandard>
+            <UseCase>0</UseCase>
+            <UseMod51>0</UseMod51>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define></Define>
+              <Undefine></Undefine>
+              <IncludePath></IncludePath>
+            </VariousControls>
+          </Ax51>
+          <Lx51>
+            <useFile>0</useFile>
+            <linkonly>0</linkonly>
+            <UseMemoryFromTarget>1</UseMemoryFromTarget>
+            <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
+            <WarningLevel>2</WarningLevel>
+            <DataOverlaying>1</DataOverlaying>
+            <OverlayString></OverlayString>
+            <MiscControls></MiscControls>
+            <DisableWarningNumbers></DisableWarningNumbers>
+            <LinkerCmdFile></LinkerCmdFile>
+            <Assign></Assign>
+            <ReserveString></ReserveString>
+            <CClasses></CClasses>
+            <UserClasses></UserClasses>
+            <CSection></CSection>
+            <UserSection></UserSection>
+            <CodeBaseAddress></CodeBaseAddress>
+            <XDataBaseAddress></XDataBaseAddress>
+            <PDataBaseAddress></PDataBaseAddress>
+            <BitBaseAddress></BitBaseAddress>
+            <DataBaseAddress></DataBaseAddress>
+            <IDataBaseAddress></IDataBaseAddress>
+            <Precede></Precede>
+            <Stack></Stack>
+            <CodeSegmentName></CodeSegmentName>
+            <XDataSegmentName></XDataSegmentName>
+            <BitSegmentName></BitSegmentName>
+            <DataSegmentName></DataSegmentName>
+            <IDataSegmentName></IDataSegmentName>
+          </Lx51>
+        </Target51>
+      </TargetOption>
+      <Groups>
+        <Group>
+          <GroupName>Source Group 1</GroupName>
+          <Files>
+            <File>
+              <FileName>STARTUP.A51</FileName>
+              <FileType>2</FileType>
+              <FilePath>.\STARTUP.A51</FilePath>
+            </File>
+            <File>
+              <FileName>MAIN.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\MAIN.C</FilePath>
+            </File>
+            <File>
+              <FileName>UART.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\UART.C</FilePath>
+            </File>
+            <File>
+              <FileName>AT_PRC.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\AT_PRC.c</FilePath>
+            </File>
+            <File>
+              <FileName>DELAY.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\DELAY.C</FilePath>
+            </File>
+            <File>
+              <FileName>PWM3.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\PWM3.C</FilePath>
+            </File>
+            <File>
+              <FileName>TIMER0.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\TIMER0.C</FilePath>
+            </File>
+            <File>
+              <FileName>DHT11.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\DHT11.C</FilePath>
+            </File>
+          </Files>
+        </Group>
+      </Groups>
+    </Target>
+  </Targets>
+
+</Project>

+ 160 - 0
ESP_8266/ASK.w

@@ -0,0 +1,160 @@
+/*************	本地常量声明	**************/
+#define MAIN_Fosc		22118400L	//定义主时钟
+#define	RX1_Lenth		32			//串口接收缓冲长度
+#define	BaudRate1		115200UL	//选择波特率
+#define	Timer1_Reload	(65536UL -(MAIN_Fosc / 4 / BaudRate1))		//Timer 1 重装值, 对应300KHZ
+#define	Timer2_Reload	(65536UL -(MAIN_Fosc / 4 / BaudRate1))		//Timer 2 重装值, 对应300KHZ
+#include	"STC15Fxxxx.H"
+/*************	本地变量声明	**************/
+u8	idata RX1_Buffer[RX1_Lenth];	//接收缓冲
+u8	TX1_Cnt;	//发送计数
+u8	RX1_Cnt;	//接收计数
+bit	B_TX1_Busy;	//发送忙标志
+/*************	端口引脚定义	**************/
+unsigned char two_lab=0;
+sbit LED1=P1^0;//LED1
+sbit LED2=P1^1;//LED2
+sbit LED3=P3^7;//LED3
+sbit DK1=P3^3;//继电器
+sbit BEEP=P3^4;//蜂鸣器
+sbit K1=P1^3;//按键1
+sbit K2=P1^2;//按键2
+sbit K3=P1^4;//按键3
+char led1bl,led2bl,led3bl;
+code unsigned char AT_RST[]="AT+RST"; 
+code unsigned char AT_MODE[]="AT+CWMODE=3";
+code unsigned char AT_CWJAP[]="AT+CWJAP=\"360we\",\"zty0012001\"";
+code unsigned char CIPSTART[]="AT+CIPSTART=\"UDP\",\"cloud.ai-thinker.com\",5001";
+code unsigned char CIPSEND_LEN[]="AT+CIPSEND=38";
+unsigned char test_buff[38]={0x55,0x26,0x00,0xA0,0x00,0xA8,0x16,0x16,0xA8,0x02,0xE6,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0xE6,0xBD,0x5B,0x55};
+unsigned send_buf[64];
+unsigned recd_buf[64];
+bit have_data=0;
+unsigned char rec_len=0;
+void Delay1(unsigned long ms)
+{
+	unsigned char i, j,k;
+	for(k=0;k<ms;k++)
+	{
+		_nop_();
+		_nop_();
+		i = 22;
+		j = 128;
+		do
+		{
+			while (--j);
+		} while (--i);
+	}
+}
+void Delay2(unsigned long cnt)
+{
+	long i;
+ 	for(i=0;i<cnt*100;i++);
+}
+void at_uart_send_str(unsigned char *str)
+{
+  unsigned char *st_p=str;
+  do{
+     SBUF=*st_p;
+	 st_p++;
+	 Delay1(1);
+	}while(*st_p);
+	SBUF='\r';
+	Delay1(1);
+	SBUF='\n';
+	Delay1(1);
+}
+void at_uart_send_buf(unsigned char *str,unsigned char len)
+{
+  unsigned char *st_p=str;
+  
+  while(len){
+     SBUF=*st_p;
+	 st_p++;
+	 Delay1(1);
+	 len--;
+	}while(*st_p);
+	SBUF='\r';
+	Delay1(1);
+	SBUF='\n';
+	Delay1(1);
+}
+void main(void)
+{
+	char i=0;
+	B_TX1_Busy = 0;
+	RX1_Cnt = 0;
+	TX1_Cnt = 0;
+	S1_8bit();				//8位数据
+	S1_USE_P30P31();		//UART1 使用P30 P31口	默认
+	AUXR &= ~(1<<4);	//Timer stop		波特率使用Timer2产生
+	AUXR |= 0x01;		//S1 BRT Use Timer2;
+	AUXR |=  (1<<2);	//Timer2 set as 1T mode
+	TH2 = (u8)(Timer2_Reload >> 8);
+	TL2 = (u8)Timer2_Reload;
+	AUXR |=  (1<<4);	//Timer run enable
+	REN = 1;	//允许接收
+	ES  = 1;	//允许中断
+	EA = 1;		//允许全局中断
+	P3M1 = 0x00;
+    P3M0 = 0xFF;
+	RX1_Cnt=0;
+	DK1=0;
+	BEEP=0;
+	for(;;)//AT+CWMODE=2 设置成路由模式
+	{
+		//SBUF='A';Delay1(1);
+		Delay2(2000);
+        at_uart_send_str(AT_MODE);
+		Delay2(2000);
+        at_uart_send_str(AT_CWJAP);
+		Delay2(4000);
+        at_uart_send_str(CIPSTART);
+		Delay2(2000);
+        at_uart_send_str(CIPSEND_LEN);
+		Delay2(2000);
+		at_uart_send_buf(test_buff,38);
+		while(1)
+		{
+		  if(have_data)
+		  {
+		    have_data=0;
+			LED1=0;
+			Delay2(200);
+		    LED1=1;
+		  }
+		}
+	}
+	Delay2(2000);
+}
+
+/********************* UART1中断函数************************/
+void UART1_int (void) interrupt UART1_VECTOR
+{
+	char i,a,b,c;
+	if(RI)
+	{
+		RI = 0;
+		LED1=0;
+		LED1=1;
+		recd_buf[RX1_Cnt] = SBUF;		//保存一个字节
+		if(RX1_Cnt<62)
+		RX1_Cnt++;
+		else
+		RX1_Cnt=0;
+		 if(recd_buf[RX1_Cnt]==0X55)
+		   two_lab++;
+		 if(two_lab==2)
+		 {
+		   have_data=1;
+		   two_lab=0;
+		   rec_len=RX1_Cnt;
+		   RX1_Cnt=0;
+		 }
+	}
+	if(TI)
+	{
+		TI = 0;
+		B_TX1_Busy = 0;		//清除发送忙标志
+	}
+}

File diff suppressed because it is too large
+ 1782 - 0
ESP_8266/ASK_uvopt.bak


+ 390 - 0
ESP_8266/ASK_uvproj.bak

@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
+
+  <SchemaVersion>1.0</SchemaVersion>
+
+  <Header>### uVision Project, (C) Keil Software</Header>
+
+  <Targets>
+    <Target>
+      <TargetName>Target 1</TargetName>
+      <ToolsetNumber>0x0</ToolsetNumber>
+      <ToolsetName>MCS-51</ToolsetName>
+      <TargetOption>
+        <TargetCommonOption>
+          <Device>SM89516A</Device>
+          <Vendor>SyncMOS</Vendor>
+          <Cpu>IRAM(0-0xFF) XRAM(0-0x2FF) IROM(0-0xFFFF) CLOCK(40000000)</Cpu>
+          <FlashUtilSpec></FlashUtilSpec>
+          <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
+          <FlashDriverDll></FlashDriverDll>
+          <DeviceId>3759</DeviceId>
+          <RegisterFile>SM89516A.H</RegisterFile>
+          <MemoryEnv></MemoryEnv>
+          <Cmp></Cmp>
+          <Asm></Asm>
+          <Linker></Linker>
+          <OHString></OHString>
+          <InfinionOptionDll></InfinionOptionDll>
+          <SLE66CMisc></SLE66CMisc>
+          <SLE66AMisc></SLE66AMisc>
+          <SLE66LinkerMisc></SLE66LinkerMisc>
+          <UseEnv>0</UseEnv>
+          <BinPath></BinPath>
+          <IncludePath></IncludePath>
+          <LibPath></LibPath>
+          <RegisterFilePath>SyncMOS\</RegisterFilePath>
+          <DBRegisterFilePath>SyncMOS\</DBRegisterFilePath>
+          <TargetStatus>
+            <Error>0</Error>
+            <ExitCodeStop>0</ExitCodeStop>
+            <ButtonStop>0</ButtonStop>
+            <NotGenerated>0</NotGenerated>
+            <InvalidFlash>1</InvalidFlash>
+          </TargetStatus>
+          <OutputDirectory>.\</OutputDirectory>
+          <OutputName>ASK</OutputName>
+          <CreateExecutable>1</CreateExecutable>
+          <CreateLib>0</CreateLib>
+          <CreateHexFile>1</CreateHexFile>
+          <DebugInformation>1</DebugInformation>
+          <BrowseInformation>1</BrowseInformation>
+          <ListingPath>.\</ListingPath>
+          <HexFormatSelection>0</HexFormatSelection>
+          <Merge32K>0</Merge32K>
+          <CreateBatchFile>0</CreateBatchFile>
+          <BeforeCompile>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </BeforeCompile>
+          <BeforeMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </BeforeMake>
+          <AfterMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+          </AfterMake>
+          <SelectedForBatchBuild>0</SelectedForBatchBuild>
+          <SVCSIdString></SVCSIdString>
+        </TargetCommonOption>
+        <CommonProperty>
+          <UseCPPCompiler>0</UseCPPCompiler>
+          <RVCTCodeConst>0</RVCTCodeConst>
+          <RVCTZI>0</RVCTZI>
+          <RVCTOtherData>0</RVCTOtherData>
+          <ModuleSelection>0</ModuleSelection>
+          <IncludeInBuild>1</IncludeInBuild>
+          <AlwaysBuild>0</AlwaysBuild>
+          <GenerateAssemblyFile>0</GenerateAssemblyFile>
+          <AssembleAssemblyFile>0</AssembleAssemblyFile>
+          <PublicsOnly>0</PublicsOnly>
+          <StopOnExitCode>3</StopOnExitCode>
+          <CustomArgument></CustomArgument>
+          <IncludeLibraryModules></IncludeLibraryModules>
+          <BankNo>65535</BankNo>
+        </CommonProperty>
+        <DllOption>
+          <SimDllName>S8051.DLL</SimDllName>
+          <SimDllArguments></SimDllArguments>
+          <SimDlgDll>DP51.DLL</SimDlgDll>
+          <SimDlgDllArguments>-p52</SimDlgDllArguments>
+          <TargetDllName>S8051.DLL</TargetDllName>
+          <TargetDllArguments></TargetDllArguments>
+          <TargetDlgDll>TP51.DLL</TargetDlgDll>
+          <TargetDlgDllArguments>-p52</TargetDlgDllArguments>
+        </DllOption>
+        <DebugOption>
+          <OPTHX>
+            <HexSelection>0</HexSelection>
+            <HexRangeLowAddress>0</HexRangeLowAddress>
+            <HexRangeHighAddress>0</HexRangeHighAddress>
+            <HexOffset>0</HexOffset>
+            <Oh166RecLen>16</Oh166RecLen>
+          </OPTHX>
+          <Simulator>
+            <UseSimulator>1</UseSimulator>
+            <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+            <RunToMain>1</RunToMain>
+            <RestoreBreakpoints>1</RestoreBreakpoints>
+            <RestoreWatchpoints>1</RestoreWatchpoints>
+            <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+            <RestoreFunctions>1</RestoreFunctions>
+            <RestoreToolbox>1</RestoreToolbox>
+            <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
+          </Simulator>
+          <Target>
+            <UseTarget>0</UseTarget>
+            <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+            <RunToMain>0</RunToMain>
+            <RestoreBreakpoints>1</RestoreBreakpoints>
+            <RestoreWatchpoints>1</RestoreWatchpoints>
+            <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+            <RestoreFunctions>0</RestoreFunctions>
+            <RestoreToolbox>1</RestoreToolbox>
+          </Target>
+          <RunDebugAfterBuild>0</RunDebugAfterBuild>
+          <TargetSelection>-1</TargetSelection>
+          <SimDlls>
+            <CpuDll></CpuDll>
+            <CpuDllArguments></CpuDllArguments>
+            <PeripheralDll></PeripheralDll>
+            <PeripheralDllArguments></PeripheralDllArguments>
+            <InitializationFile></InitializationFile>
+          </SimDlls>
+          <TargetDlls>
+            <CpuDll></CpuDll>
+            <CpuDllArguments></CpuDllArguments>
+            <PeripheralDll></PeripheralDll>
+            <PeripheralDllArguments></PeripheralDllArguments>
+            <InitializationFile></InitializationFile>
+            <Driver></Driver>
+          </TargetDlls>
+        </DebugOption>
+        <Utilities>
+          <Flash1>
+            <UseTargetDll>0</UseTargetDll>
+            <UseExternalTool>0</UseExternalTool>
+            <RunIndependent>0</RunIndependent>
+            <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
+            <Capability>0</Capability>
+            <DriverSelection>-1</DriverSelection>
+          </Flash1>
+          <Flash2></Flash2>
+          <Flash3></Flash3>
+          <Flash4></Flash4>
+        </Utilities>
+        <Target51>
+          <Target51Misc>
+            <MemoryModel>2</MemoryModel>
+            <RTOS>0</RTOS>
+            <RomSize>2</RomSize>
+            <DataHold>0</DataHold>
+            <XDataHold>0</XDataHold>
+            <UseOnchipRom>0</UseOnchipRom>
+            <UseOnchipArithmetic>0</UseOnchipArithmetic>
+            <UseMultipleDPTR>0</UseMultipleDPTR>
+            <UseOnchipXram>0</UseOnchipXram>
+            <HadIRAM>1</HadIRAM>
+            <HadXRAM>1</HadXRAM>
+            <HadIROM>1</HadIROM>
+            <Moda2>0</Moda2>
+            <Moddp2>0</Moddp2>
+            <Modp2>0</Modp2>
+            <Mod517dp>0</Mod517dp>
+            <Mod517au>0</Mod517au>
+            <Mode2>0</Mode2>
+            <useCB>0</useCB>
+            <useXB>0</useXB>
+            <useL251>0</useL251>
+            <useA251>0</useA251>
+            <Mx51>0</Mx51>
+            <ModC812>0</ModC812>
+            <ModCont>0</ModCont>
+            <Lp51>0</Lp51>
+            <useXBS>0</useXBS>
+            <ModDA>0</ModDA>
+            <ModAB2>0</ModAB2>
+            <Mx51P>0</Mx51P>
+            <hadXRAM2>0</hadXRAM2>
+            <uocXram2>0</uocXram2>
+            <ModC2>0</ModC2>
+            <ModH2>0</ModH2>
+            <Mdu_R515>0</Mdu_R515>
+            <Mdu_F120>0</Mdu_F120>
+            <Psoc>0</Psoc>
+            <hadIROM2>0</hadIROM2>
+            <ModSmx2>0</ModSmx2>
+            <cBanks>0</cBanks>
+            <xBanks>0</xBanks>
+            <OnChipMemories>
+              <RCB>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0xffff</Size>
+              </RCB>
+              <RXB>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </RXB>
+              <Ocm1>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm1>
+              <Ocm2>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm2>
+              <Ocm3>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm3>
+              <Ocr1>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr1>
+              <Ocr2>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr2>
+              <Ocr3>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocr3>
+              <IRO>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x10000</Size>
+              </IRO>
+              <IRA>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x100</Size>
+              </IRA>
+              <XRA>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x300</Size>
+              </XRA>
+              <XRA512>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </XRA512>
+              <IROM512>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </IROM512>
+            </OnChipMemories>
+          </Target51Misc>
+          <C51>
+            <RegisterColoring>0</RegisterColoring>
+            <VariablesInOrder>0</VariablesInOrder>
+            <IntegerPromotion>1</IntegerPromotion>
+            <uAregs>0</uAregs>
+            <UseInterruptVector>1</UseInterruptVector>
+            <Fuzzy>3</Fuzzy>
+            <Optimize>6</Optimize>
+            <WarningLevel>2</WarningLevel>
+            <SizeSpeed>1</SizeSpeed>
+            <ObjectExtend>1</ObjectExtend>
+            <ACallAJmp>0</ACallAJmp>
+            <InterruptVectorAddress>0</InterruptVectorAddress>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define></Define>
+              <Undefine></Undefine>
+              <IncludePath></IncludePath>
+            </VariousControls>
+          </C51>
+          <Ax51>
+            <UseMpl>0</UseMpl>
+            <UseStandard>1</UseStandard>
+            <UseCase>0</UseCase>
+            <UseMod51>0</UseMod51>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define></Define>
+              <Undefine></Undefine>
+              <IncludePath></IncludePath>
+            </VariousControls>
+          </Ax51>
+          <Lx51>
+            <useFile>0</useFile>
+            <linkonly>0</linkonly>
+            <UseMemoryFromTarget>1</UseMemoryFromTarget>
+            <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
+            <WarningLevel>2</WarningLevel>
+            <DataOverlaying>1</DataOverlaying>
+            <OverlayString></OverlayString>
+            <MiscControls></MiscControls>
+            <DisableWarningNumbers></DisableWarningNumbers>
+            <LinkerCmdFile></LinkerCmdFile>
+            <Assign></Assign>
+            <ReserveString></ReserveString>
+            <CClasses></CClasses>
+            <UserClasses></UserClasses>
+            <CSection></CSection>
+            <UserSection></UserSection>
+            <CodeBaseAddress></CodeBaseAddress>
+            <XDataBaseAddress></XDataBaseAddress>
+            <PDataBaseAddress></PDataBaseAddress>
+            <BitBaseAddress></BitBaseAddress>
+            <DataBaseAddress></DataBaseAddress>
+            <IDataBaseAddress></IDataBaseAddress>
+            <Precede></Precede>
+            <Stack></Stack>
+            <CodeSegmentName></CodeSegmentName>
+            <XDataSegmentName></XDataSegmentName>
+            <BitSegmentName></BitSegmentName>
+            <DataSegmentName></DataSegmentName>
+            <IDataSegmentName></IDataSegmentName>
+          </Lx51>
+        </Target51>
+      </TargetOption>
+      <Groups>
+        <Group>
+          <GroupName>Source Group 1</GroupName>
+          <Files>
+            <File>
+              <FileName>STARTUP.A51</FileName>
+              <FileType>2</FileType>
+              <FilePath>.\STARTUP.A51</FilePath>
+            </File>
+            <File>
+              <FileName>MAIN.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\MAIN.C</FilePath>
+            </File>
+            <File>
+              <FileName>UART.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\UART.C</FilePath>
+            </File>
+            <File>
+              <FileName>AT_PRC.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\AT_PRC.c</FilePath>
+            </File>
+            <File>
+              <FileName>DELAY.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\DELAY.C</FilePath>
+            </File>
+            <File>
+              <FileName>PWM3.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\PWM3.C</FilePath>
+            </File>
+            <File>
+              <FileName>TIMER0.C</FileName>
+              <FileType>1</FileType>
+              <FilePath>.\TIMER0.C</FilePath>
+            </File>
+          </Files>
+        </Group>
+      </Groups>
+    </Target>
+  </Targets>
+
+</Project>

+ 50 - 0
ESP_8266/AT_PRC.H

@@ -0,0 +1,50 @@
+
+void change_pack();					  //把接收到的数据包转义过来,0X55 转义成0X54 0X01 0X54 替换成0X54 02
+extern data unsigned char stac_a;		      //全局专用变量
+extern unsigned char stac_b;			  //全局专用变量
+extern xdata unsigned char send_buf[64];	                     //发送缓冲区
+extern idata unsigned char recd_buf[64];						 //接收缓冲区
+extern data unsigned char temp_buf[72];
+extern unsigned char two_lab;
+extern void make_AT_CIP3(void);
+extern code unsigned char AT_CIP3[];
+extern code unsigned char cip3_lcport[];
+extern unsigned char esp_dev_id[8]; 
+extern unsigned char esp_user_data[14];
+extern unsigned char at_send_len_ox[20];
+extern code unsigned char temp_bander[];
+extern code unsigned char CIPSEND_LEN[];
+extern code unsigned char AT_CLDSEND[];
+extern bit t_o;	
+												 //  在构造一个如00123 的数据时候,去掉前面的00变成123 这里若碰到0就置1
+//将16进制数,变成16进制字符比如10变成A
+extern char back_char(unsigned char user_d);
+
+////制作 向手机发送如下格式UDP数据
+////RPT:"0x00FE6738","0xB8B3C281","192.168.0.123","light","123456a"
+extern void make_bander_data();
+
+
+extern void make_AT_SEND_LEN(unsigned char a_len,unsigned char DATA_S);   //生成右边这样的指令,将参数a_len 改成10进制,右边这条指令  "AT+CIPSEND=XX" XX是发送的数量
+
+extern void at_uart_send_str(unsigned char *str);//发送AT字符串到串口
+
+extern void at_uart_send_buf(unsigned char *str,unsigned char len);//发送数据缓冲区的非字符串信息,数据流信息到串口
+
+
+extern void init_uart(void);
+
+extern unsigned char	TX1_Cnt;	//发送计数
+extern unsigned char	RX1_Cnt;	//接收计数
+extern bit	B_TX1_Busy;	//发送忙标志
+
+#define	RX1_Lenth		32			//串口接收缓冲长度
+#define	BaudRate1		115200UL	//选择波特率
+#define	Timer1_Reload	(65536UL -(MAIN_Fosc / 4 / BaudRate1))		//Timer 1 重装值, 对应300KHZ
+#define	Timer2_Reload	(65536UL -(MAIN_Fosc / 4 / BaudRate1))		//Timer 2 重装值, 对应300KHZ
+#define LOC_data 0
+#define RMT_data 1
+#define MAIN_Fosc		22118400L	//定义主时钟
+
+
+

+ 138 - 0
ESP_8266/AT_PRC.LST

@@ -0,0 +1,138 @@
+C51 COMPILER V9.00   AT_PRC                                                                08/06/2015 08:09:34 PAGE 1   
+
+
+C51 COMPILER V9.00, COMPILATION OF MODULE AT_PRC
+OBJECT MODULE PLACED IN AT_PRC.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE AT_PRC.c LARGE OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #include"AT_PRC.H"      
+   2          #include"STC15FXXXX.H"
+   3          #include"DELAY.h"
+   4          #define S1_S0 0x40              //P_SW1.6
+   5          #define S1_S1 0x80              //P_SW1.7
+   6          
+   7          
+   8          #define MAIN_Fosc       22118400L  //定义主时钟
+   9          #define Timer0_Rate     25000       //中断频率
+  10          
+  11          
+  12          typedef     unsigned char   u8;
+  13          typedef     unsigned int    u16;
+  14          typedef     unsigned long   u32;
+  15          
+  16          
+  17          
+  18          #define Timer0_Reload   (65536UL -(MAIN_Fosc / Timer0_Rate)) 
+  19          
+  20          void at_uart_send_str(unsigned char *str)//发送AT字符串到串口
+  21          {
+  22   1        unsigned char *st_p=str;
+  23   1        do{
+  24   2           SBUF=*st_p;
+  25   2               st_p++;
+  26   2               Delay2(1);
+  27   2              }while(*st_p);
+  28   1              SBUF='\r';
+  29   1              Delay2(1);
+  30   1              SBUF='\n';
+  31   1              Delay2(1);
+  32   1      }
+  33          void at_uart_send_buf(unsigned char *str,unsigned char len)//ݻķַϢϢ
+             -
+  34          {
+  35   1        unsigned char *st_p=str;
+  36   1        
+  37   1        while(len){
+  38   2           SBUF=*st_p;
+  39   2               st_p++;
+  40   2               Delay2(1);
+  41   2               len--;
+  42   2              }
+  43   1              Delay2(1);
+  44   1      }
+  45          
+  46          void init_uart(void)
+  47          {
+  48   1              B_TX1_Busy = 0;
+  49   1              RX1_Cnt = 0;
+  50   1              TX1_Cnt = 0;
+  51   1              S1_8bit();                              //8位数据
+  52   1              S1_USE_P30P31();                //UART1 使用P30 P31口   默认
+  53   1              AUXR &= ~(1<<4);        //Timer stop            波特率使用Timer2产生
+  54   1              AUXR |= 0x01;           //S1 BRT Use Timer2;
+C51 COMPILER V9.00   AT_PRC                                                                08/06/2015 08:09:34 PAGE 2   
+
+  55   1              AUXR |=  (1<<2);        //Timer2 set as 1T mode
+  56   1              TH2 = (unsigned char)(Timer2_Reload >> 8);
+  57   1              TL2 = (unsigned char)Timer2_Reload;
+  58   1              AUXR |=  (1<<4);        //Timer run enable
+  59   1              REN = 1;        //允许接收
+  60   1              ES  = 1;        //允许中断
+  61   1              EA = 1;         //允许全局中断
+  62   1              PS=1;
+  63   1              P3M1 = 0x00;
+  64   1          P3M0 = 0xFF;
+  65   1              RX1_Cnt=0;
+  66   1              ACC = P_SW1;
+  67   1          ACC &= ~(S1_S0 | S1_S1);    //S1_S0=1 S1_S1=0
+  68   1          ACC |= S1_S0;               //(P3.6/RxD_2, P3.7/TxD_2)
+  69   1          P_SW1 = ACC;                                 //(P3.0/RX,P3.1/TX)
+  70   1      }
+  71          
+  72          
+  73          
+  74          void make_AT_SEND_LEN(unsigned char a_len,unsigned char DATA_S)   //生成右边这样的指令,将参数a_len 改成10
+             -进制,右边这条指令  "AT+CIPSEND=XX" XX是发送的数量
+  75          {
+  76   1        unsigned char aa=0;
+  77   1        for(aa=0;aa<20;aa++)
+  78   1        at_send_len_ox[aa]=0;
+  79   1      
+  80   1        for(aa=0;aa<11;aa++)
+  81   1        {
+  82   2          if(DATA_S==LOC_data)
+  83   2          at_send_len_ox[aa]=CIPSEND_LEN[aa];  //剪贴"AT+CIPSEND= 到RAM  后面的十进制参数由下面的部分生成
+  84   2              else if(DATA_S==RMT_data)
+  85   2              at_send_len_ox[aa]=AT_CLDSEND[aa];       //剪贴"AT+CIPSEND= 到RAM  后面的十进制参数由下面的部分生成
+  86   2        }
+  87   1        t_o=0;                                 //去掉前面的0,比如发送38个字节,038,前面的0就可以去掉了。
+  88   1        if((a_len/100))
+  89   1        {
+  90   2        at_send_len_ox[aa]=a_len/100+'0';
+  91   2        aa++;
+  92   2        t_o=1;
+  93   2        }
+  94   1        if((a_len%100)/10)
+  95   1        {
+  96   2        at_send_len_ox[aa]=(a_len%100)/10+'0';
+  97   2        aa++;
+  98   2        t_o=1;
+  99   2        }
+ 100   1        else if(t_o)
+ 101   1        {
+ 102   2          at_send_len_ox[aa]=0+'0';
+ 103   2              aa++;
+ 104   2        }
+ 105   1        at_send_len_ox[aa]=(a_len%10)+'0';
+ 106   1        aa++;
+ 107   1        at_send_len_ox[aa]=0;
+ 108   1      }
+ 109          
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =    411    ----
+   CONSTANT SIZE    =   ----    ----
+   XDATA SIZE       =   ----       7
+C51 COMPILER V9.00   AT_PRC                                                                08/06/2015 08:09:34 PAGE 3   
+
+   PDATA SIZE       =   ----    ----
+   DATA SIZE        =   ----    ----
+   IDATA SIZE       =   ----    ----
+   BIT SIZE         =   ----    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

BIN
ESP_8266/AT_PRC.OBJ


+ 109 - 0
ESP_8266/AT_PRC.c

@@ -0,0 +1,109 @@
+#include"AT_PRC.H"	
+#include"STC15FXXXX.H"
+#include"DELAY.h"
+#define S1_S0 0x40              //P_SW1.6
+#define S1_S1 0x80              //P_SW1.7
+
+
+#define MAIN_Fosc       22118400L  //定义主时钟
+#define Timer0_Rate     25000       //中断频率
+
+
+typedef     unsigned char   u8;
+typedef     unsigned int    u16;
+typedef     unsigned long   u32;
+
+
+
+#define Timer0_Reload   (65536UL -(MAIN_Fosc / Timer0_Rate)) 
+
+void at_uart_send_str(unsigned char *str)//发送AT字符串到串口
+{
+  unsigned char *st_p=str;
+  do{
+     SBUF=*st_p;
+	 st_p++;
+	 Delay2(1);
+	}while(*st_p);
+	SBUF='\r';
+	Delay2(1);
+	SBUF='\n';
+	Delay2(1);
+}
+void at_uart_send_buf(unsigned char *str,unsigned char len)//发送数据缓冲区的非字符串信息,数据流信息到串口
+{
+  unsigned char *st_p=str;
+  
+  while(len){
+     SBUF=*st_p;
+	 st_p++;
+	 Delay2(1);
+	 len--;
+	}
+	Delay2(1);
+}
+
+void init_uart(void)
+{
+  	B_TX1_Busy = 0;
+	RX1_Cnt = 0;
+	TX1_Cnt = 0;
+	S1_8bit();				//8位数据
+	S1_USE_P30P31();		//UART1 使用P30 P31口	默认
+	AUXR &= ~(1<<4);	//Timer stop		波特率使用Timer2产生
+	AUXR |= 0x01;		//S1 BRT Use Timer2;
+	AUXR |=  (1<<2);	//Timer2 set as 1T mode
+	TH2 = (unsigned char)(Timer2_Reload >> 8);
+	TL2 = (unsigned char)Timer2_Reload;
+	AUXR |=  (1<<4);	//Timer run enable
+	REN = 1;	//允许接收
+	ES  = 1;	//允许中断
+	EA = 1;		//允许全局中断
+	PS=1;
+	P3M1 = 0x00;
+    P3M0 = 0xFF;
+	RX1_Cnt=0;
+	ACC = P_SW1;
+    ACC &= ~(S1_S0 | S1_S1);    //S1_S0=1 S1_S1=0
+    ACC |= S1_S0;               //(P3.6/RxD_2, P3.7/TxD_2)
+    P_SW1 = ACC; 				 //(P3.0/RX,P3.1/TX)
+}
+
+
+
+void make_AT_SEND_LEN(unsigned char a_len,unsigned char DATA_S)   //生成右边这样的指令,将参数a_len 改成10进制,右边这条指令  "AT+CIPSEND=XX" XX是发送的数量
+{
+  unsigned char aa=0;
+  for(aa=0;aa<20;aa++)
+  at_send_len_ox[aa]=0;
+
+  for(aa=0;aa<11;aa++)
+  {
+    if(DATA_S==LOC_data)
+    at_send_len_ox[aa]=CIPSEND_LEN[aa];	 //剪贴"AT+CIPSEND= 到RAM  后面的十进制参数由下面的部分生成
+	else if(DATA_S==RMT_data)
+	at_send_len_ox[aa]=AT_CLDSEND[aa];	 //剪贴"AT+CIPSEND= 到RAM  后面的十进制参数由下面的部分生成
+  }
+  t_o=0;                                 //去掉前面的0,比如发送38个字节,038,前面的0就可以去掉了。
+  if((a_len/100))
+  {
+  at_send_len_ox[aa]=a_len/100+'0';
+  aa++;
+  t_o=1;
+  }
+  if((a_len%100)/10)
+  {
+  at_send_len_ox[aa]=(a_len%100)/10+'0';
+  aa++;
+  t_o=1;
+  }
+  else if(t_o)
+  {
+    at_send_len_ox[aa]=0+'0';
+	aa++;
+  }
+  at_send_len_ox[aa]=(a_len%10)+'0';
+  aa++;
+  at_send_len_ox[aa]=0;
+}
+

+ 51 - 0
ESP_8266/CRC16.C

@@ -0,0 +1,51 @@
+#define __CRC16.C_
+#include"CRC16.H"
+/////////////////////////////////////////////////////////////////下面部分定义了CRC16校验函数用到的表格///////////////////////////////////
+code unsigned int crc_table[256]=
+{               /* CRC余式表 */
+0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
+0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
+0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
+0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
+0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
+0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
+0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
+0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
+0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
+0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
+0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
+0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
+0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
+0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
+0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
+0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
+0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
+0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
+0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
+0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
+0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
+0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
+0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
+0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
+0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
+0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
+0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
+0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
+0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
+0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
+0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
+0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
+};
+
+//下面函数获得CRC校验码 采用标准CRC16 初始CRC=0XFFFF  运算多项式参数 8005 非1021
+unsigned int GetRevCrc_16(unsigned char * pData, int nLength)
+{
+  unsigned int cRc_16 = 0xffff;
+  unsigned char temp;
+  while(nLength-- > 0)
+  {
+    temp = cRc_16&0xff; 
+    cRc_16 = (cRc_16 >> 8) ^ crc_table[(temp ^ *pData++) & 0xFF];
+  }
+  return cRc_16;    
+}

+ 4 - 0
ESP_8266/CRC16.H

@@ -0,0 +1,4 @@
+#ifndef __CRC16_H__
+#define __CRC16_H__
+unsigned int GetRevCrc_16(unsigned char * pData, int nLength);
+#endif

+ 77 - 0
ESP_8266/CRC16.LST

@@ -0,0 +1,77 @@
+C51 COMPILER V9.01   CRC16                                                                 05/16/2015 13:00:38 PAGE 1   
+
+
+C51 COMPILER V9.01, COMPILATION OF MODULE CRC16
+OBJECT MODULE PLACED IN CRC16.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE CRC16.C COMPACT OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #define __CRC16.C_
+   2          #include"CRC16.H"
+   3          /////////////////////////////////////////////////////////////////下面部分定义了CRC16校验函数用到的表格////
+             -///////////////////////////////
+   4          code unsigned int crc_table[256]=
+   5          {               /* CRC余式表 */
+   6          0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
+   7          0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
+   8          0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
+   9          0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
+  10          0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
+  11          0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
+  12          0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
+  13          0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
+  14          0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
+  15          0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
+  16          0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
+  17          0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
+  18          0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
+  19          0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
+  20          0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
+  21          0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
+  22          0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
+  23          0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
+  24          0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
+  25          0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
+  26          0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
+  27          0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
+  28          0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
+  29          0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
+  30          0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
+  31          0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
+  32          0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
+  33          0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
+  34          0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
+  35          0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
+  36          0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
+  37          0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
+  38          };
+  39          
+  40          //下面函数获得CRC校验码 采用标准CRC16 初始CRC=0XFFFF  运算多项式参数 8005 非1021
+  41          unsigned int GetRevCrc_16(unsigned char * pData, int nLength)
+  42          {
+  43   1        unsigned int cRc_16 = 0xffff;
+  44   1        unsigned char temp;
+  45   1        while(nLength-- > 0)
+  46   1        {
+  47   2          temp = cRc_16&0xff; 
+  48   2          cRc_16 = (cRc_16 >> 8) ^ crc_table[(temp ^ *pData++) & 0xFF];
+  49   2        }
+  50   1        return cRc_16;    
+  51   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+C51 COMPILER V9.01   CRC16                                                                 05/16/2015 13:00:38 PAGE 2   
+
+   CODE SIZE        =    116    ----
+   CONSTANT SIZE    =    512    ----
+   XDATA SIZE       =   ----    ----
+   PDATA SIZE       =   ----       8
+   DATA SIZE        =   ----    ----
+   IDATA SIZE       =   ----    ----
+   BIT SIZE         =   ----    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

BIN
ESP_8266/CRC16.OBJ


+ 131 - 0
ESP_8266/CRC16CCIT.C

@@ -0,0 +1,131 @@
+						   /*------------------------------------------------------------------------------
+HELLO.C
+
+Copyright 1995-2005 Keil Software, Inc.
+------------------------------------------------------------------------------*/
+
+#include <REG52.H>                /* special function register declarations   */
+                                  /* for the intended 8051 derivative         */
+
+#include <stdio.h>                /* prototype declarations for I/O functions */
+
+
+#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */
+char code reserve [3] _at_ 0x23;         /* space for serial interrupt if     */
+#endif                                   /* Stop Exection with Serial Intr.   */
+                                         /* is enabled                        */
+
+
+/*------------------------------------------------
+The main C function.  Program execution starts
+here after stack initialization.
+------------------------------------------------*/
+#define CRC_SEED   0xFFFF   // 该位称为预置值,使用人工算法(长除法)时 需要将除数多项式先与该与职位 异或 ,才能得到最后的除数多项式
+#define POLY16 0x1021  // 该位为简式书写 实际为0x11021
+unsigned char crc_16[35]={0x55,0x26,0x00,0xA0,0x00,0xA8,0x16,0x16,0xA8,0x02,0xE6,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0xe6};
+unsigned char crc_12[6]={1,3,0,0,0,1};
+code unsigned int crc_table[256]={               /* CRC余式表 */
+    0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+    0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+    0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+    0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+    0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+    0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+    0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+    0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+    0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+    0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+    0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+    0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+    0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+    0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+    0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+    0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+    0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+    0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+    0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+    0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+    0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+    0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+    0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+    0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+    0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+    0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+    0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+    0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+    0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+    0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+    0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+    0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
+  };
+/*
+unsigned int crc16(unsigned char *buf,unsigned short length)
+{
+  int shift,data1,val;
+  int i;
+
+  shift = CRC_SEED;
+
+
+  for(i=0;i<length;i++) {
+    if((i % 8) == 0)
+      data1 = (*buf++)<<8;
+    val = shift ^ data1;
+    shift = shift<<1;
+    data1 = data1 <<1;
+    if(val&0x8000)
+      shift = shift ^ POLY16;
+  }
+  return shift;
+} 
+*/
+
+
+unsigned char crc_t=0;
+unsigned int crc=0;
+unsigned int do_crc_table(unsigned char *ptr,int len)
+{
+   unsigned int crc;
+   unsigned char da;
+   crc=0;
+   while(len--!=0) 
+    { 
+
+       da=(unsigned char) (crc/256); //存储CRC的高8位
+
+       crc<<=8;//左移8位,相当于CRC的低8位乘以2^8
+
+       
+       crc^= crc_table[da^*ptr];         ptr++;
+
+      //高8位和当前字节相加后再查表求的CRC,再加上以前的CRC
+      }
+   return(crc);
+}
+
+void main (void) {
+
+/*------------------------------------------------
+Setup the serial port for 1200 baud at 16MHz.
+------------------------------------------------*/
+#ifndef MONITOR51
+    SCON  = 0x50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */
+    TMOD |= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
+    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */
+    TR1   = 1;                  /* TR1:  timer 1 run                          */
+    TI    = 1;                  /* TI:   set TI to send first char of UART    */
+#endif
+
+/*------------------------------------------------
+Note that an embedded program never exits (because
+there is no operating system to return to).  It
+must loop and execute forever.
+------------------------------------------------*/
+crc=do_crc_table(crc_16,35);
+  while (1) {
+    P1 ^= 0x01;     		    /* Toggle P1.0 each time we print */
+    printf ("Hello World\n");   /* Print "Hello World" */
+  }
+}
+
+

+ 15 - 0
ESP_8266/DELAY.C

@@ -0,0 +1,15 @@
+#include"DELAY.H"
+#include "intrins.h"
+void delay_5us(unsigned char us)
+{
+  unsigned char i=0;
+  for(;us;us--)
+  for(i=0;i<14;i++);
+}
+
+
+void Delay2(unsigned long cnt)
+{
+   for(;cnt;cnt--)
+   delay_5us(200);
+}

+ 3 - 0
ESP_8266/DELAY.H

@@ -0,0 +1,3 @@
+void Delay1(unsigned long ms);//简单延迟函数,单位是毫秒
+void Delay2(unsigned long cnt);
+void delay_5us(unsigned char us);

+ 38 - 0
ESP_8266/DELAY.LST

@@ -0,0 +1,38 @@
+C51 COMPILER V9.00   DELAY                                                                 08/06/2015 08:09:34 PAGE 1   
+
+
+C51 COMPILER V9.00, COMPILATION OF MODULE DELAY
+OBJECT MODULE PLACED IN DELAY.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE DELAY.C LARGE OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #include"DELAY.H"
+   2          #include "intrins.h"
+   3          void delay_5us(unsigned char us)
+   4          {
+   5   1        unsigned char i=0;
+   6   1        for(;us;us--)
+   7   1        for(i=0;i<14;i++);
+   8   1      }
+   9          
+  10          
+  11          void Delay2(unsigned long cnt)
+  12          {
+  13   1         for(;cnt;cnt--)
+  14   1         delay_5us(200);
+  15   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =     88    ----
+   CONSTANT SIZE    =   ----    ----
+   XDATA SIZE       =   ----       4
+   PDATA SIZE       =   ----    ----
+   DATA SIZE        =   ----    ----
+   IDATA SIZE       =   ----    ----
+   BIT SIZE         =   ----    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

BIN
ESP_8266/DELAY.OBJ


+ 67 - 0
ESP_8266/DHT11.C

@@ -0,0 +1,67 @@
+#include"STC15FXXXX.H"
+#include"delay.h"
+sbit DHT = P3^5;
+unsigned char TP_H=0;
+unsigned char TP_L=0;
+unsigned char RH_H=0;
+unsigned char RH_L=0;
+unsigned char CR_D=0;
+bit ch_1_0(void)
+{
+  unsigned char t=0;
+  delay_5us(6);
+  while(DHT==0);
+  for(t=0;DHT;t++)
+  delay_5us(1); 
+  if(t>10)
+  return 1;
+  else
+  return 0;
+}
+sbit BEEP=P3^4;//·äÃùÆ÷
+void read_dh(void)	  //DHT11 ¶ÁÈ¡³ÌÐò
+{
+  unsigned char i;
+  DHT=0;
+  Delay2(20);
+  DHT=1;
+  delay_5us(10);
+  while(DHT==0);
+  delay_5us(6);
+  while(DHT);
+  for(i=0;i<8;i++)
+  {
+  if(ch_1_0())
+  TP_H=((TP_H<<1)+1);
+  else
+  TP_H<<=1;
+  }
+  for(i=0;i<8;i++)
+  {
+  if(ch_1_0())
+  TP_L=((TP_L<<1)+1);
+  else
+  TP_L<<=1;
+  }
+    for(i=0;i<8;i++)
+  {
+  if(ch_1_0())
+  RH_H=((RH_H<<1)+1);
+  else
+  RH_H<<=1;
+  }
+    for(i=0;i<8;i++)
+  {
+  if(ch_1_0())
+  RH_L=((RH_L<<1)+1);
+  else
+  RH_L<<=1;
+  }
+  for(i=0;i<8;i++)
+  {
+  if(ch_1_0())
+  CR_D=((CR_D<<1)+1);
+  else
+  CR_D<<=1;
+  }
+}

+ 92 - 0
ESP_8266/DHT11.LST

@@ -0,0 +1,92 @@
+C51 COMPILER V9.00   DHT11                                                                 08/06/2015 08:09:34 PAGE 1   
+
+
+C51 COMPILER V9.00, COMPILATION OF MODULE DHT11
+OBJECT MODULE PLACED IN DHT11.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE DHT11.C LARGE OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #include"STC15FXXXX.H"
+   2          #include"delay.h"
+   3          sbit DHT = P3^5;
+   4          unsigned char TP_H=0;
+   5          unsigned char TP_L=0;
+   6          unsigned char RH_H=0;
+   7          unsigned char RH_L=0;
+   8          unsigned char CR_D=0;
+   9          bit ch_1_0(void)
+  10          {
+  11   1        unsigned char t=0;
+  12   1        delay_5us(6);
+  13   1        while(DHT==0);
+  14   1        for(t=0;DHT;t++)
+  15   1        delay_5us(1); 
+  16   1        if(t>10)
+  17   1        return 1;
+  18   1        else
+  19   1        return 0;
+  20   1      }
+  21          sbit BEEP=P3^4;//·äÃùÆ÷
+  22          void read_dh(void)        //DHT11 ¶ÁÈ¡³ÌÐò
+  23          {
+  24   1        unsigned char i;
+  25   1        DHT=0;
+  26   1        Delay2(20);
+  27   1        DHT=1;
+  28   1        delay_5us(10);
+  29   1        while(DHT==0);
+  30   1        delay_5us(6);
+  31   1        while(DHT);
+  32   1        for(i=0;i<8;i++)
+  33   1        {
+  34   2        if(ch_1_0())
+  35   2        TP_H=((TP_H<<1)+1);
+  36   2        else
+  37   2        TP_H<<=1;
+  38   2        }
+  39   1        for(i=0;i<8;i++)
+  40   1        {
+  41   2        if(ch_1_0())
+  42   2        TP_L=((TP_L<<1)+1);
+  43   2        else
+  44   2        TP_L<<=1;
+  45   2        }
+  46   1          for(i=0;i<8;i++)
+  47   1        {
+  48   2        if(ch_1_0())
+  49   2        RH_H=((RH_H<<1)+1);
+  50   2        else
+  51   2        RH_H<<=1;
+  52   2        }
+  53   1          for(i=0;i<8;i++)
+  54   1        {
+  55   2        if(ch_1_0())
+C51 COMPILER V9.00   DHT11                                                                 08/06/2015 08:09:34 PAGE 2   
+
+  56   2        RH_L=((RH_L<<1)+1);
+  57   2        else
+  58   2        RH_L<<=1;
+  59   2        }
+  60   1        for(i=0;i<8;i++)
+  61   1        {
+  62   2        if(ch_1_0())
+  63   2        CR_D=((CR_D<<1)+1);
+  64   2        else
+  65   2        CR_D<<=1;
+  66   2        }
+  67   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =    284    ----
+   CONSTANT SIZE    =   ----    ----
+   XDATA SIZE       =      5       2
+   PDATA SIZE       =   ----    ----
+   DATA SIZE        =   ----    ----
+   IDATA SIZE       =   ----    ----
+   BIT SIZE         =   ----    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

BIN
ESP_8266/DHT11.OBJ


+ 4 - 0
ESP_8266/EEPROM.C

@@ -0,0 +1,4 @@
+
+
+
+

+ 27 - 0
ESP_8266/EEPROM.LST

@@ -0,0 +1,27 @@
+C51 COMPILER V9.01   EEPROM                                                                06/24/2015 11:00:58 PAGE 1   
+
+
+C51 COMPILER V9.01, COMPILATION OF MODULE EEPROM
+OBJECT MODULE PLACED IN EEPROM.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE EEPROM.C COMPACT OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          
+   2          
+   3          
+   4          
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =   ----    ----
+   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)

BIN
ESP_8266/EEPROM.OBJ


+ 40 - 0
ESP_8266/EPROM.C

@@ -0,0 +1,40 @@
+#define __EPROM.C_								 
+#include"EPROM.H"
+#include "STC15Fxxxx.H"
+void IapIdle()
+{
+  IAP_CONTR=0;
+  IAP_CMD=0;
+  IAP_TRIG=0;
+  IAP_ADDRH=0X80;
+  IAP_ADDRL=0;
+}
+
+BYTE IapReadByte(WORD addr)
+{
+   BYTE dat;
+   IAP_CONTR=ENABLE_IAP;
+   IAP_CMD=CMD_READ;
+   IAP_ADDRL=addr;
+   IAP_ADDRH=addr>>8;
+   IAP_TRIG=0x5a;
+   IAP_TRIG=0xa5;
+   _nop_();
+   dat=IAP_DATA;
+   IapIdle();
+   return dat;
+}
+
+
+
+void IapEraseSector(WORD addr)
+{
+  IAP_CONTR=ENABLE_IAP;
+  IAP_CMD=CMD_ERASE;
+  IAP_ADDRL=addr;
+  IAP_ADDRH=addr>>8;
+  IAP_TRIG=0x5a;
+  IAP_TRIG=0xa5;
+  _nop_();
+  IapIdle();
+}

+ 27 - 0
ESP_8266/EPROM.H

@@ -0,0 +1,27 @@
+#ifndef __EPROM_H__
+#define __EPROM_H__
+
+typedef unsigned char BYTE;
+typedef unsigned int WORD;
+void IapIdle();
+BYTE IapReadBYTE(WORD addr);
+#define MAIN_Fosc		22118400L	//定义主时钟
+#define EEPROM_SSID_LC     0  		//定义SSID 存在FLASH上的相对位置
+#define EEPROM_PASSWORD_LC 64		//定义密码 存在FLASH上的相对位置
+#define EEPROM_LAB         128		//定义是否已将路由器账户和密码保存到FLASH中
+#define CMD_IDLE      0
+#define CMD_READ      1
+#define CMD_PROGRAM   2
+#define CMD_ERASE     3
+#define ENABLE_IAP  0X81
+#define IAP_ADDRESS 0X1200	//设置客户参数保存的位置,这里选择FLASH的最后一个扇区。
+void Delay(BYTE n);
+void IapIdle();
+BYTE IapReadByte(WORD addr);
+void IapProgramByte(WORD addr,BYTE dat);
+void IapEraseSector(WORD addr);
+
+#endif
+										  /////////////////////////////////////////////////////////////////////以下部分是STC的掉电存储程序,读写内部的EEPROM 保存上网账户和密码////////////////////////
+
+

+ 63 - 0
ESP_8266/EPROM.LST

@@ -0,0 +1,63 @@
+C51 COMPILER V9.01   EPROM                                                                 06/24/2015 11:40:24 PAGE 1   
+
+
+C51 COMPILER V9.01, COMPILATION OF MODULE EPROM
+OBJECT MODULE PLACED IN EPROM.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE EPROM.C COMPACT OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1          #define __EPROM.C_                                                               
+   2          #include"EPROM.H"
+   3          #include "STC15Fxxxx.H"
+   4          void IapIdle()
+   5          {
+   6   1        IAP_CONTR=0;
+   7   1        IAP_CMD=0;
+   8   1        IAP_TRIG=0;
+   9   1        IAP_ADDRH=0X80;
+  10   1        IAP_ADDRL=0;
+  11   1      }
+  12          
+  13          BYTE IapReadByte(WORD addr)
+  14          {
+  15   1         BYTE dat;
+  16   1         IAP_CONTR=ENABLE_IAP;
+  17   1         IAP_CMD=CMD_READ;
+  18   1         IAP_ADDRL=addr;
+  19   1         IAP_ADDRH=addr>>8;
+  20   1         IAP_TRIG=0x5a;
+  21   1         IAP_TRIG=0xa5;
+  22   1         _nop_();
+  23   1         dat=IAP_DATA;
+  24   1         IapIdle();
+  25   1         return dat;
+  26   1      }
+  27          
+  28          
+  29          
+  30          void IapEraseSector(WORD addr)
+  31          {
+  32   1        IAP_CONTR=ENABLE_IAP;
+  33   1        IAP_CMD=CMD_ERASE;
+  34   1        IAP_ADDRL=addr;
+  35   1        IAP_ADDRH=addr>>8;
+  36   1        IAP_TRIG=0x5a;
+  37   1        IAP_TRIG=0xa5;
+  38   1        _nop_();
+  39   1        IapIdle();
+  40   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =     59    ----
+   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)

BIN
ESP_8266/EPROM.OBJ


BIN
ESP_8266/HELLO


+ 173 - 0
ESP_8266/HELLO.LST

@@ -0,0 +1,173 @@
+C51 COMPILER V9.01   HELLO                                                                 04/27/2015 09:44:28 PAGE 1   
+
+
+C51 COMPILER V9.01, COMPILATION OF MODULE HELLO
+OBJECT MODULE PLACED IN HELLO.OBJ
+COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE HELLO.C OPTIMIZE(5,SPEED) BROWSE DEBUG OBJECTEXTEND
+
+line level    source
+
+   1                                            /*************        本地常量声明    **************/
+   2          #define MAIN_Fosc               22118400L       //定义主时钟
+   3          #define RX1_Lenth               32                      //串口接收缓冲长度
+   4          #define BaudRate1               115200UL        //选择波特率
+   5          #define Timer1_Reload   (65536UL -(MAIN_Fosc / 4 / BaudRate1))          //Timer 1 重装值, 对应300KHZ
+   6          #define Timer2_Reload   (65536UL -(MAIN_Fosc / 4 / BaudRate1))          //Timer 2 重装值, 对应300KHZ
+   7          #include        "STC15Fxxxx.H"
+   8          /*************  本地变量声明    **************/
+   9          u8      idata RX1_Buffer[RX1_Lenth];    //接收缓冲
+  10          u8      TX1_Cnt;        //发送计数
+  11          u8      RX1_Cnt;        //接收计数
+  12          bit     B_TX1_Busy;     //发送忙标志
+  13          /*************  端口引脚定义    **************/
+  14          sbit LED1=P1^0;//LED1
+  15          sbit LED2=P1^1;//LED2
+  16          sbit LED3=P3^7;//LED3
+  17          sbit DK1=P3^3;//继电器
+  18          sbit BEEP=P3^4;//蜂鸣器
+  19          sbit K1=P1^3;//按键1
+  20          sbit K2=P1^2;//按键2
+  21          sbit K3=P1^4;//按键3
+  22          char led1bl,led2bl,led3bl;
+  23          code unsigned char AT_RST[]="AT+RST\n"; 
+  24          void Delay1(unsigned long ms)
+  25          {
+  26   1              unsigned char i, j,k;
+  27   1              for(k=0;k<ms;k++)
+  28   1              {
+  29   2                      _nop_();
+  30   2                      _nop_();
+  31   2                      i = 22;
+  32   2                      j = 128;
+  33   2                      do
+  34   2                      {
+  35   3                              while (--j);
+  36   3                      } while (--i);
+  37   2              }
+  38   1      }
+  39          unsigned char crc_16[35]={0x55,0x26,0x00,0xA0,0x00,0xA8,0x16,0x16,0xA8,0x02,0xE6,0x1E,0x00,0x00,0x00,0x00,
+             -0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0xe6};
+  40          code unsigned int crc_table[256]=
+  41          {               /* CRC余式表 */
+  42          0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
+  43          0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
+  44          0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
+  45          0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
+  46          0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
+  47          0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
+  48          0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
+  49          0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
+  50          0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
+  51          0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
+  52          0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
+  53          0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
+  54          0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
+C51 COMPILER V9.01   HELLO                                                                 04/27/2015 09:44:28 PAGE 2   
+
+  55          0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
+  56          0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
+  57          0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
+  58          0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
+  59          0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
+  60          0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
+  61          0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
+  62          0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
+  63          0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
+  64          0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
+  65          0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
+  66          0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
+  67          0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
+  68          0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
+  69          0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
+  70          0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
+  71          0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
+  72          0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
+  73          0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
+  74          };
+  75          unsigned int GetRevCrc_16(unsigned char * pData, int nLength)
+  76          {
+  77   1        unsigned int cRc_16 = 0xffff;
+  78   1        unsigned char temp;
+  79   1      
+  80   1        while(nLength-- > 0)
+  81   1        {
+  82   2          temp = cRc_16&0xff; 
+  83   2          cRc_16 = (cRc_16 >> 8) ^ crc_table[(temp ^ *pData++) & 0xFF];
+  84   2        }
+  85   1      
+  86   1        return cRc_16;    
+  87   1      }
+  88          void uart_send_str(unsigned char *str)
+  89          {
+  90   1        unsigned char *st_p=str;
+  91   1        do{
+  92   2           SBUF=*st_p;
+  93   2               st_p++;
+  94   2               Delay1(1);
+  95   2              }while(*st_p);
+  96   1      }
+  97          void main(void)
+  98          {
+  99   1              char i=0;
+ 100   1              unsigned int crc=0;
+ 101   1              crc=GetRevCrc_16(crc_16,35);
+ 102   1              B_TX1_Busy = 0;
+ 103   1              RX1_Cnt = 0;
+ 104   1              TX1_Cnt = 0;
+ 105   1              S1_8bit();                              //8位数据
+ 106   1              S1_USE_P30P31();                //UART1 使用P30 P31口   默认
+ 107   1              AUXR &= ~(1<<4);        //Timer stop            波特率使用Timer2产生
+ 108   1              AUXR |= 0x01;           //S1 BRT Use Timer2;
+ 109   1              AUXR |=  (1<<2);        //Timer2 set as 1T mode
+ 110   1              TH2 = (u8)(Timer2_Reload >> 8);
+ 111   1              TL2 = (u8)Timer2_Reload;
+ 112   1              AUXR |=  (1<<4);        //Timer run enable
+ 113   1              REN = 1;        //允许接收
+ 114   1              ES  = 1;        //允许中断
+ 115   1              EA = 1;         //允许全局中断
+ 116   1              P3M1 = 0x00;
+C51 COMPILER V9.01   HELLO                                                                 04/27/2015 09:44:28 PAGE 3   
+
+ 117   1          P3M0 = 0xFF;
+ 118   1              RX1_Cnt=0;
+ 119   1              DK1=0;
+ 120   1              BEEP=0;
+ 121   1              Delay1(500);
+ 122   1              while(1)
+ 123   1              {
+ 124   2              Delay1(500);
+ 125   2              //uart_send_str(AT_RST);
+ 126   2              SBUF='A';
+ 127   2              }
+ 128   1      }
+ 129          
+ 130          /********************* UART1中断函数************************/
+ 131          void UART1_int (void) interrupt UART1_VECTOR
+ 132          {
+ 133   1      
+ 134   1              if(RI)
+ 135   1              {
+ 136   2                      RI = 0;
+ 137   2                      RX1_Buffer[RX1_Cnt] = SBUF;             //保存一个字节
+ 138   2      
+ 139   2              }
+ 140   1              if(TI)
+ 141   1              {
+ 142   2                      TI = 0;
+ 143   2                      B_TX1_Busy = 0;         //清除发送忙标志
+ 144   2              }
+ 145   1      }
+
+
+MODULE INFORMATION:   STATIC OVERLAYABLE
+   CODE SIZE        =    330    ----
+   CONSTANT SIZE    =    520    ----
+   XDATA SIZE       =   ----    ----
+   PDATA SIZE       =   ----    ----
+   DATA SIZE        =     40      19
+   IDATA SIZE       =     32    ----
+   BIT SIZE         =      1    ----
+END OF MODULE INFORMATION.
+
+
+C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

+ 253 - 0
ESP_8266/HELLO.M51

@@ -0,0 +1,253 @@
+BL51 BANKED LINKER/LOCATER V6.22                                                        04/27/2015  09:44:28  PAGE 1
+
+
+BL51 BANKED LINKER/LOCATER V6.22, INVOKED BY:
+C:\KEIL\C51\BIN\BL51.EXE HELLO.obj TO HELLO RAMSIZE (256)
+
+
+MEMORY MODEL: SMALL
+
+
+INPUT MODULES INCLUDED:
+  HELLO.obj (HELLO)
+  C:\KEIL\C51\LIB\C51S.LIB (?C_STARTUP)
+  C:\KEIL\C51\LIB\C51S.LIB (?C?CLDPTR)
+  C:\KEIL\C51\LIB\C51S.LIB (?C?ULCMP)
+  C:\KEIL\C51\LIB\C51S.LIB (?C_INIT)
+
+
+LINK MAP OF MODULE:  HELLO (HELLO)
+
+
+            TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
+            -----------------------------------------------------
+
+            * * * * * * *   D A T A   M E M O R Y   * * * * * * *
+            REG     0000H     0008H     ABSOLUTE     "REG BANK 0"
+            DATA    0008H     000BH     UNIT         _DATA_GROUP_
+            DATA    0013H     0003H     UNIT         ?DT?_UART_SEND_STR?HELLO
+                    0016H     000AH                  *** GAP ***
+            BIT     0020H.0   0000H.1   UNIT         ?BI?HELLO
+                    0020H.1   0000H.7                *** GAP ***
+            DATA    0021H     0028H     UNIT         ?DT?HELLO
+            IDATA   0049H     0020H     UNIT         ?ID?HELLO
+            IDATA   0069H     0001H     UNIT         ?STACK
+
+            * * * * * * *   C O D E   M E M O R Y   * * * * * * *
+            CODE    0000H     0003H     ABSOLUTE     
+                    0003H     0020H                  *** GAP ***
+            CODE    0023H     0003H     ABSOLUTE     
+            CODE    0026H     0208H     UNIT         ?CO?HELLO
+            CODE    022EH     008CH     UNIT         ?C_C51STARTUP
+            CODE    02BAH     0065H     UNIT         ?PR?MAIN?HELLO
+            CODE    031FH     005DH     UNIT         ?PR?_GETREVCRC_16?HELLO
+            CODE    037CH     0033H     UNIT         ?PR?_UART_SEND_STR?HELLO
+            CODE    03AFH     0032H     UNIT         ?PR?_DELAY1?HELLO
+            CODE    03E1H     002AH     UNIT         ?C?LIB_CODE
+            CODE    040BH     0027H     UNIT         ?C_INITSEG
+            CODE    0432H     0023H     UNIT         ?PR?UART1_INT?HELLO
+
+
+
+OVERLAY MAP OF MODULE:   HELLO (HELLO)
+
+
+SEGMENT                            DATA_GROUP 
+  +--> CALLED SEGMENT            START    LENGTH
+------------------------------------------------
+?C_C51STARTUP                    -----    -----
+  +--> ?PR?MAIN?HELLO
+  +--> ?C_INITSEG
+
+BL51 BANKED LINKER/LOCATER V6.22                                                      04/27/2015  09:44:28  PAGE 2
+
+
+?PR?MAIN?HELLO                   0008H    0003H
+  +--> ?PR?_GETREVCRC_16?HELLO
+  +--> ?PR?_DELAY1?HELLO
+
+?PR?_GETREVCRC_16?HELLO          000BH    0008H
+  +--> ?CO?HELLO
+
+?PR?_DELAY1?HELLO                000BH    0005H
+
+
+
+SYMBOL TABLE OF MODULE:  HELLO (HELLO)
+
+  VALUE           TYPE          NAME
+  ----------------------------------
+
+  -------         MODULE        HELLO
+  C:0000H         SYMBOL        _ICE_DUMMY_
+  D:0080H         PUBLIC        P0
+  D:0021H         PUBLIC        crc_16
+  D:00B2H         PUBLIC        P3M0
+  D:0090H         PUBLIC        P1
+  D:00B1H         PUBLIC        P3M1
+  D:00A0H         PUBLIC        P2
+  D:00B0H         PUBLIC        P3
+  D:00C0H         PUBLIC        P4
+  D:00C8H         PUBLIC        P5
+  B:0020H.0       PUBLIC        B_TX1_Busy
+  B:00A8H.7       PUBLIC        EA
+  C:037CH         PUBLIC        _uart_send_str
+  D:00A2H         PUBLIC        P_SW1
+  D:00A8H         PUBLIC        IE
+  B:00A8H.4       PUBLIC        ES
+  D:00B8H         PUBLIC        IP
+  I:0049H         PUBLIC        RX1_Buffer
+  B:0098H.0       PUBLIC        RI
+  C:0432H         PUBLIC        UART1_int
+  B:00B0H.4       PUBLIC        BEEP
+  B:0098H.1       PUBLIC        TI
+  C:03AFH         PUBLIC        _Delay1
+  D:00D8H         PUBLIC        CCON
+  C:002EH         PUBLIC        crc_table
+  C:02BAH         PUBLIC        main
+  D:0099H         PUBLIC        SBUF
+  C:031FH         PUBLIC        _GetRevCrc_16
+  D:0098H         PUBLIC        SCON
+  D:0088H         PUBLIC        TCON
+  D:0044H         PUBLIC        led1bl
+  D:0045H         PUBLIC        led2bl
+  D:0046H         PUBLIC        led3bl
+  B:00B0H.3       PUBLIC        DK1
+  D:00F0H         PUBLIC        B
+  D:008EH         PUBLIC        AUXR
+  D:00E0H         PUBLIC        ACC
+  D:00D6H         PUBLIC        TH2
+  D:00D7H         PUBLIC        TL2
+  D:0047H         PUBLIC        RX1_Cnt
+BL51 BANKED LINKER/LOCATER V6.22                                                      04/27/2015  09:44:28  PAGE 3
+
+
+  D:0048H         PUBLIC        TX1_Cnt
+  B:0098H.4       PUBLIC        REN
+  C:0026H         PUBLIC        AT_RST
+  D:00D0H         PUBLIC        PSW
+  -------         PROC          _DELAY1
+  D:000BH         SYMBOL        ms
+  -------         DO            
+  D:0007H         SYMBOL        i
+  D:0006H         SYMBOL        j
+  D:000FH         SYMBOL        k
+  -------         ENDDO         
+  C:03AFH         LINE#         24
+  C:03B7H         LINE#         25
+  C:03B7H         LINE#         27
+  C:03CEH         LINE#         28
+  C:03CEH         LINE#         29
+  C:03CFH         LINE#         30
+  C:03D0H         LINE#         31
+  C:03D2H         LINE#         32
+  C:03D4H         LINE#         34
+  C:03D4H         LINE#         35
+  C:03D8H         LINE#         36
+  C:03DCH         LINE#         37
+  C:03E0H         LINE#         38
+  -------         ENDPROC       _DELAY1
+  -------         PROC          _GETREVCRC_16
+  D:000BH         SYMBOL        pData
+  D:000EH         SYMBOL        nLength
+  -------         DO            
+  D:0010H         SYMBOL        cRc_16
+  D:0012H         SYMBOL        temp
+  -------         ENDDO         
+  C:031FH         LINE#         75
+  C:0329H         LINE#         76
+  C:0329H         LINE#         77
+  C:032FH         LINE#         80
+  C:0343H         LINE#         81
+  C:0343H         LINE#         82
+  C:0347H         LINE#         83
+  C:0375H         LINE#         84
+  C:0377H         LINE#         86
+  C:037BH         LINE#         87
+  -------         ENDPROC       _GETREVCRC_16
+  -------         PROC          _UART_SEND_STR
+  D:0001H         SYMBOL        str
+  -------         DO            
+  D:0013H         SYMBOL        st_p
+  -------         ENDDO         
+  C:037CH         LINE#         88
+  C:037CH         LINE#         89
+  C:037CH         LINE#         90
+  C:0382H         LINE#         91
+  C:0382H         LINE#         92
+  C:038DH         LINE#         93
+  C:0398H         LINE#         94
+  C:03A3H         LINE#         95
+  C:03AEH         LINE#         96
+BL51 BANKED LINKER/LOCATER V6.22                                                      04/27/2015  09:44:28  PAGE 4
+
+
+  -------         ENDPROC       _UART_SEND_STR
+  -------         PROC          MAIN
+  -------         DO            
+  D:0008H         SYMBOL        i
+  D:0009H         SYMBOL        crc
+  -------         ENDDO         
+  C:02BAH         LINE#         97
+  C:02BAH         LINE#         98
+  C:02BAH         LINE#         99
+  C:02BDH         LINE#         100
+  C:02C1H         LINE#         101
+  C:02D0H         LINE#         102
+  C:02D2H         LINE#         103
+  C:02D5H         LINE#         104
+  C:02D7H         LINE#         105
+  C:02DFH         LINE#         106
+  C:02E2H         LINE#         107
+  C:02E5H         LINE#         108
+  C:02E8H         LINE#         109
+  C:02EBH         LINE#         110
+  C:02EEH         LINE#         111
+  C:02F1H         LINE#         112
+  C:02F4H         LINE#         113
+  C:02F6H         LINE#         114
+  C:02F8H         LINE#         115
+  C:02FAH         LINE#         116
+  C:02FDH         LINE#         117
+  C:0300H         LINE#         118
+  C:0302H         LINE#         119
+  C:0304H         LINE#         120
+  C:0306H         LINE#         121
+  C:030EH         LINE#         122
+  C:030EH         LINE#         123
+  C:030EH         LINE#         124
+  C:0319H         LINE#         126
+  C:031CH         LINE#         127
+  -------         ENDPROC       MAIN
+  -------         PROC          UART1_INT
+  C:0432H         LINE#         131
+  C:043BH         LINE#         134
+  C:043EH         LINE#         135
+  C:043EH         LINE#         136