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

📄 term3.lst

📁 使用单片机C8050F330对无线发射接受模块进行配置与控制,使组件成为一个无线通讯中的基站.
💻 LST
📖 第 1 页 / 共 4 页
字号:
 607   2         }
 608   1      
 609   1          if(FrameLength==2)                   //deal with other frame
 610   1          {
C51 COMPILER V7.50   TERM3                                                                 04/06/2007 17:58:07 PAGE 11  

 611   2            if(UartBuff==0x0D) CRByte=UartBuff;               //received CR
 612   2      
 613   2            if(UartBuff==0x0A) LFByte=UartBuff;           //received LF
 614   2      
 615   2            if(CRByte&&LFByte)             //received CR and LF,end of frame
 616   2            {
 617   3              RecvByte=0;              //clear byte counter
 618   3              FrameLength=0;           //clear frame length
 619   3              CRByte=0;                //clear CR byte
 620   3              LFByte=0;                //clear LF byte
 621   3              
 622   3              for (ii=0;ii<9;ii++)         // Longitude
 623   3              {
 624   4                 Longitude[ii]=0x30;
 625   4              }
 626   3              for (ii=0;ii<10;ii++)        // Latitude
 627   3              {
 628   4                Latitude[ii]=0x30;
 629   4              }
 630   3          
 631   3              DGPS=0x30;
 632   3      
 633   3              for (ii=0;ii<4;ii++)         // HDOP
 634   3              {
 635   4                HDOP[ii]=0x30;
 636   4              }                       
 637   3                  //IsGpsFrame=1;
 638   3              //gps_ok=99;
 639   3            }
 640   2          }
 641   1      
 642   1         if(FrameLength==1)                      //deal with the "$GPGGA" frame
 643   1          {
 644   2            if((RecvByte>7)&&(RecvByte<18)) UTCtime[tmp-7]=UartBuff;     //received UTCtime
 645   2      
 646   2            if((RecvByte==20)&&(UartBuff==','))  FrameLength=2;//????,???????,???????
 647   2            if((RecvByte>18)&&(RecvByte<28)) Longitude[tmp-18]=UartBuff; //received jing du
 648   2      
 649   2            if((RecvByte>30)&&(RecvByte<41)) Latitude[tmp-30]=UartBuff;  //received wei du
 650   2      
 651   2            if (RecvByte==44) DGPS=UartBuff;
 652   2            
 653   2            if((RecvByte>45)&&(RecvByte<48)) weixing[tmp-45]=UartBuff;  //received weixing ge shu
 654   2            
 655   2            else if ((RecvByte>48)&&(RecvByte<53)&&(UartBuff!=',')) 
 656   2            {
 657   3              HDOP[tmp-48]=UartBuff; 
 658   3            }
 659   2            
 660   2            if(RecvByte>60)  //52
 661   2            {
 662   3              if(UartBuff==0x0D) CRByte=UartBuff;          //received CR
 663   3      
 664   3              if(UartBuff==0x0A) LFByte=UartBuff;           //receive
 665   3      
 666   3              if(CRByte&&LFByte)             //received CR and LF,end of frame
 667   3              {
 668   4                RecvByte=0;              //clear byte counter
 669   4                FrameLength=0;           //clear frame length
 670   4                CRByte=0;                //clear CR byte
 671   4                LFByte=0;                //clear LF byte
 672   4                IsGpsFrame=1;
C51 COMPILER V7.50   TERM3                                                                 04/06/2007 17:58:07 PAGE 12  

 673   4      //          IsGpsFrame++;
 674   4                gps_ok=99;
 675   4              }
 676   3            }
 677   2          }
 678   1      
 679   1         if(FrameLength==3)                      //deal with the "$GPGGA" frame
 680   1          {
 681   2            if((RecvByte>55)&&(RecvByte<62)) riqi[tmp-55]=UartBuff;     //received Data
 682   2      
 683   2            if(RecvByte>62)  //52
 684   2            {
 685   3              if(UartBuff==0x0D) CRByte=UartBuff;          //received CR
 686   3      
 687   3              if(UartBuff==0x0A) LFByte=UartBuff;           //receive
 688   3      
 689   3              if(CRByte&&LFByte)             //received CR and LF,end of frame
 690   3              {
 691   4                RecvByte=0;              //clear byte counter
 692   4                FrameLength=0;           //clear frame length
 693   4                CRByte=0;                //clear CR byte
 694   4                LFByte=0;                //clear LF byte
 695   4                //IsGpsFrame=1;
 696   4                //gps_ok=99;
 697   4              }
 698   3            }
 699   2          }
 700   1      
 701   1        TI0=0;
 702   1      }
 703          /*/---------------------------------------------------------
 704          //      
 705          //-------------------------------------------------------*/
 706          
 707          void Send_GPS(void)
 708          {
 709   1        unsigned char i;
 710   1        unsigned char CK1;
 711   1        unsigned char CK2;
 712   1        short int j=0,m,n;
 713   1      
 714   1          STI=0;
 715   1      //--------------------
 716   1      //数据侦头      
 717   1          j=j+'S';    
 718   1          CCF1=1;
 719   1          TDR='S';
 720   1          while(!STI);       
 721   1          STI=0;
 722   1              
 723   1          j=j+'J';
 724   1          CCF1=1;
 725   1          TDR='J';
 726   1          while(!STI);
 727   1          STI=0;
 728   1      
 729   1          j=j+'-';
 730   1          CCF1=1;
 731   1          TDR='-';
 732   1          while(!STI);
 733   1          STI=0;
 734   1              
C51 COMPILER V7.50   TERM3                                                                 04/06/2007 17:58:07 PAGE 13  

 735   1              j=j+'N';
 736   1          CCF1=1;
 737   1          TDR='N';
 738   1          while(!STI);
 739   1          STI=0;
 740   1                      
 741   1          j=j+'a';
 742   1          CCF1=1;     
 743   1          TDR='a';
 744   1          while(!STI);
 745   1          STI=0;
 746   1        
 747   1          j=j+'v';
 748   1          CCF1=1;
 749   1          TDR='v';
 750   1          while(!STI);
 751   1          STI=0;
 752   1              
 753   1          j=j+'i';
 754   1          CCF1=1;     
 755   1          TDR='i';
 756   1          while(!STI);
 757   1          STI=0;
 758   1              
 759   1          j=j+',';
 760   1          CCF1=1;
 761   1          TDR=',';    
 762   1          while(!STI);
 763   1          STI=0;
 764   1      //--------------------
 765   1      //访问终端的地址
 766   1          m = ADDRESS /10000+48;
 767   1              n = ADDRESS %10000;
 768   1              j=j+m;
 769   1              CCF1=1;
 770   1              TDR=m;
 771   1              while(!STI);
 772   1              STI=0;
 773   1      
 774   1          m = n /1000+48;
 775   1              n = n %1000;
 776   1              j=j+m+48;
 777   1              CCF1=1;
 778   1              TDR=m;
 779   1              while(!STI);
 780   1              STI=0;
 781   1      
 782   1          m = n /100+48;
 783   1              n = n %100;
 784   1              j=j+m;
 785   1              CCF1=1;
 786   1              TDR=m;
 787   1              while(!STI);
 788   1              STI=0;
 789   1      
 790   1          m = n /10+48;
 791   1              n = n %10+48;
 792   1              j=j+m;
 793   1              CCF1=1;
 794   1              TDR=m;
 795   1              while(!STI);
 796   1              STI=0;
C51 COMPILER V7.50   TERM3                                                                 04/06/2007 17:58:07 PAGE 14  

 797   1      
 798   1              j=j+n;
 799   1              CCF1=1;
 800   1              TDR=n;
 801   1              while(!STI);
 802   1              STI=0;
 803   1          
 804   1      
 805   1      /*----------------------
 806   1          j=j+ADDR_H;
 807   1          CCF1=1;
 808   1          TDR=ADDR_H; 
 809   1          while(!STI);
 810   1          STI=0;
 811   1      
 812   1          j=j+ADDR_L;
 813   1          CCF1=1;
 814   1          TDR=ADDR_L; 
 815   1          while(!STI);
 816   1          STI=0;
 817   1       */
 818   1      
 819   1          j=j+',';
 820   1          CCF1=1;
 821   1          TDR=',';    
 822   1          while(!STI);
 823   1          STI=0;
 824   1      //--------------------*/
 825   1      //访问终端的命令
 826   1          j=j+'2';
 827   1          CCF1=1;
 828   1          TDR='2';    
 829   1          while(!STI);
 830   1          STI=0;
 831   1      
 832   1          j=j+'C';
 833   1          CCF1=1;
 834   1          TDR='C';    
 835   1          while(!STI);
 836   1          STI=0;
 837   1      
 838   1          j=j+',';
 839   1          CCF1=1;
 840   1          TDR=',';    
 841   1          while(!STI);
 842   1          STI=0;
 843   1      
 844   1         if ((riqi[5]>0x39) || (riqi[5]<0x30)) riqi[5]=5+0x30;
 845   1         if ((riqi[4]>0x31) || (riqi[4]<0x30)) riqi[4]=0+0x30;
 846   1         if ((riqi[3]>0x39) || (riqi[3]<0x30)) riqi[3]=2+0x30;
 847   1         if ((riqi[2]>0x31) || (riqi[2]<0x30)) riqi[2]=1+0x30;
 848   1         if ((riqi[1]>0x39) || (riqi[1]<0x30)) riqi[1]=5+0x30;
 849   1         if ((riqi[0]>0x33) || (riqi[0]<0x30)) riqi[0]=2+0x30;
 850   1      //--------------------
 851   1      //发送年月日
 852   1         for (i=0;i<6;i++)               //send UTC time
 853   1         {
 854   2            j=j+riqi[i];
 855   2            CCF1=1;
 856   2            TDR=riqi[i]; 
 857   2            while(!STI);
 858   2            STI=0;               
C51 COMPILER V7.50   TERM3                                                                 04/06/2007 17:58:07 PAGE 15  

 859   2         }
 860   1              
 861   1      /*
 862   1         for (i=0;i<6;i++)               //send UTC time
 863   1         {
 864   1            j=j+UTCtime[i];
 865   1            CCF1=1;
 866   1            TDR=UTCtime[i]; 
 867   1            while(!STI);
 868   1            STI=0;               
 869   1         }    
 870   1      */
 871   1              
 872   1          j=j+',';
 873   1          CCF1=1;
 874   1          TDR=',';    
 875   1          while(!STI);
 876   1          STI=0;      
 877   1              
 878   1          CCF1=1;
 879   1          TDR='*';    
 880   1          while(!STI);
 881   1          STI=0;      
 882   1      
 883   1          j=j%256;
 884   1              
 885   1          CK1=j/16;
 886   1          CK2=j%16;
 887   1          if (CK1>9) CK1=CK1+55;
 888   1          else CK1=CK1+48;
 889   1      
 890   1          CCF1=1;
 891   1          TDR=CK1;    
 892   1          while(!STI);
 893   1          STI=0; 
 894   1              
 895   1          if (CK2>9) CK2=CK2+55;
 896   1          else CK2=CK2+48;
 897   1              
 898   1          CCF1=1;
 899   1          TDR=CK2;    
 900   1          while(!STI);
 901   1          STI=0;                      
 902   1              
 903   1          CCF1=1; //SEND CR
 904   1          TDR=13;     
 905   1          while(!STI);
 906   1          STI=0;      
 907   1              
 908   1          CCF1=1;//SEND LF
 909   1          TDR=10;     
 910   1          while(!STI);
 911   1          STI=0; 
 912   1                      
 913   1      }
 914          

⌨️ 快捷键说明

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