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

📄 bdtrv20.lst

📁 单片机C源程序souce
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.06   BDTRV20                                                               11/20/2006 19:28:54 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE BDTRV20
OBJECT MODULE PLACED IN BDTRV20.OBJ
COMPILER INVOKED BY: E:\keil\C51\BIN\C51.EXE BDTRV20.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /**************************************
   2          File          :  BDTRV20.C
   3          Project       :  BDTRV20_MCU_V07
   4          Description   :  
   5          Created       :  2004
   6          Last updata   :  2004
   7          Author        :  wangwenyu
   8          Compile Tool  :  Keil
   9          Target Device :  SST89V564RD
  10          Circuit Board :  7700
  11          ************************************
  12          Modification History
  13          ************************************
  14           Version      : v1.4
  15           Date         : MM/DD/YYYY
  16           Modifier     :
  17           Description  :
  18          
  19           **********************************
  20           -- Copyright (c)
  21           *************************************/
  22          
  23          #include <SST89V564.H>
  24          #include <ABSACC.H>
  25          #include <CTYPE.H>
  26          #include "head_def.h"
  27          
  28          /*********************************************************************/
  29          //unsigned char code DataStr[]=__DATE__;
  30          //unsigned char code TimeStr[]=__TIME__;
  31          
  32          /*********************************************************************/
  33          void init4136(void);//SI4136 initialization.
  34          void RunIAPCode(void);
  35          extern InitModule(void);//Initialize the BD-RF-Module.
  36          extern InitMCU(void);//Initialize the MCU.
  37          extern senddsp(void);//Send data to DSP through Parallel port.
  38          extern wdt(void);//Watchdog timer.
  39          extern delay(unsigned char time);//Delay subprogram.
  40          extern BootDSP(void);//Initialize the DSP for run code.
  41          extern InitDSP(void);//Initialize the Port of DSP.
  42          extern rdDSP(void);//Read data from DSP and send through serial port.
  43          extern InitMoudel(void);//Initialize the BD-RF-Moudle.
  44          extern rev_frame(void);
  45          extern ch_frame(void);
  46          extern sd_uart(void);
  47          //extern func_cf(void);
  48          //extern func_ci(void);
  49          extern WriteCont(unsigned char CMD,unsigned char addr,unsigned char DataArray[],unsigned char offset);
  50          extern unsigned char READ(unsigned char CMD,unsigned char addr);
  51          
  52          /*********************************************************************/
  53          
  54          void main(void)
  55          {
C51 COMPILER V7.06   BDTRV20                                                               11/20/2006 19:28:54 PAGE 2   

  56   1       unsigned char i;
  57   1      //Initialize the Registers of the MCU.
  58   1      InitMCU();
  59   1      
  60   1      RunIAP=0;
  61   1      IAP=1;
  62   1      //
  63   1      moto_fg=1; //系统默认为motonola二进制形式
  64   1      cf_rst =0;
  65   1      u_cf_fg=1;//
  66   1      //u_ay_fg =1;//
  67   1      u_fg=1;//
  68   1      sec_fg =1;//
  69   1      u_gd_fg =0;
  70   1      
  71   1      while(1)
  72   1              {
  73   2              while(Dtime!=0)
  74   2                      {
  75   3                      P34=~P34;
  76   3                      if (RunIAP==1)
  77   3                              {
  78   4                              RunIAP=0;
  79   4                              RunIAPCode();
  80   4                              }
  81   3                      }
  82   2              IAP=0;
  83   2              goto RUN;
  84   2              }
  85   1      
  86   1      RUN:
  87   1      TR0 = 0;//Stop the timer 0.
  88   1      ET0 = 0;//Disable the interruption T0.
  89   1      
  90   1      ES = 0;
  91   1      TR1 = 0;
  92   1      PCON = 0x00;
  93   1      TH1 = 0xfa;     //Set baud rate to 9600bps.
  94   1      TL1 = 0xfa;
  95   1      TR1 = 1;
  96   1      //Initialize the flags.
  97   1      flagint=0;
  98   1      flagserial=0;
  99   1      
 100   1      //Iniatialize the RF Moudel.
 101   1      InitModule();
 102   1      delay(5);
 103   1      //Initialize SI4136.
 104   1      init4136();     //SI4136 initialization.
 105   1      //Boot the DSP5402.
 106   1      delay(10);              //Delay 500ms for boot DSP. 
 107   1      BootDSP();
 108   1      
 109   1      //Enable the interruptions.
 110   1      EX0=1;//Enable the interruption 0.
 111   1      ES=1;//Enable the serial interruption.
 112   1      EA=1;//Open the interruptions.
 113   1      
 114   1      //Initlizate the Parallel Port of DSP.
 115   1      InitDSP();
 116   1      /******************************************************/
 117   1        delay(200);
C51 COMPILER V7.06   BDTRV20                                                               11/20/2006 19:28:54 PAGE 3   

 118   1      /*  delay(200);
 119   1        delay(200);
 120   1        delay(200);
 121   1        delay(200);
 122   1        delay(200);
 123   1        delay(200);
 124   1        delay(200);*/
 125   1      
 126   1      //Initilze the Position.
 127   1      if (READ(0x03,0x00)=='$')
 128   1        {
 129   2        delay(200);
 130   2        //delay(200);
 131   2        rdata[0] = READ(0x03,0);
 132   2        rdata[1] = READ(0x03,1);
 133   2        i=2;
 134   2        while((rdata[i-2] != 0x0d)&&(rdata[i-1] != 0x0a))
 135   2          {
 136   3          rdata[i] = READ(0x03,i);
 137   3          i++;
 138   3          if (i>63)
 139   3              {
 140   4              rdata[i-2] = 0x0d;
 141   4              rdata[i-1] = 0x0a;
 142   4              }
 143   3          }
 144   2        if (i < 63)
 145   2          {
 146   3          RXLen = i;
 147   3          senddsp();
 148   3              long_asc[0]=rdata[21];
 149   3              long_asc[1]=rdata[22];
 150   3              long_asc[2]=rdata[23];
 151   3              long_asc[3]=rdata[24];
 152   3      
 153   3              lat_asc[0]=rdata[7];
 154   3              lat_asc[1]=rdata[8];
 155   3              lat_asc[2]=rdata[9];
 156   3              lat_asc[3]=rdata[10];
 157   3              for(i=0;i<12;i++)
 158   3                  {
 159   4                      if (i<=3)
 160   4                        {
 161   5                        lat_par=lat_par<<8;
 162   5                        lat_par|= READ(0x03,(0x90+i));                  
 163   5                        }
 164   4                      else if(i>3&&i<=7)
 165   4                        {
 166   5                        long_par=long_par<<8;
 167   5                        long_par|= READ(0x03,(0x90+i));                 
 168   5                        }             
 169   4                      else if(i>7&&i<=11)
 170   4                        {
 171   5                        high_par=high_par<<8;
 172   5                        high_par|= READ(0x03,(0x90+i));                 
 173   5                        }      
 174   4                      }
 175   3      
 176   3              for (i=0;i< RXLen;i++)
 177   3                  {
 178   4                      SBUF =rdata[i];
 179   4                      while(!TI);
C51 COMPILER V7.06   BDTRV20                                                               11/20/2006 19:28:54 PAGE 4   

 180   4                      TI =0;
 181   4                      }
 182   3          /*TX_Busy = 1;
 183   3          TXLen = RXLen;
 184   3          for (i=0;i<RXLen;i++)
 185   3            {
 186   3             sdata[i] = rdata[i];
 187   3            }
 188   3          TXCont = 0;
 189   3              SBUF = sdata[TXCont++];*/
 190   3          }
 191   2        }
 192   1      //Initilze the Beam.

⌨️ 快捷键说明

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