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

📄 main.lst

📁 一个调整ADC gain offset 的程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
 131   2         printf("inital the FPGA board fail!\n");
 132   2         return;
 133   2        }
 134   1        else
 135   1              {
 136   2              printf("inital the FPGA board successful!\n");
 137   2              FPGABoardLEDSet(0,TRUE);
 138   2              }
 139   1      
 140   1          //EEPROMGxSettingSet(); 
 141   1          //EEPROMGxSettingGet();
 142   1        //  FPGABoardLEDSet(1,TRUE);
 143   1         #ifdef IIC 
                      dvRegisterWrite(IIC_FPGA_SLAVE_Addr, 0xe8, 0x00); 
                  #endif
 146   1           #ifdef DATABUS
 147   1               DisplayLED=0x00;
 148   1             #endif
 149   1             for(i=0;i<2;i++)
 150   1              FPGABoardClear(i);
 151   1             
 152   1             
 153   1             while(1)//detect FPGA board
 154   1              {
 155   2                cBoardSel = 2;
 156   2                #ifdef IIC  
                           dvRegisterRead(IIC_FPGA_SLAVE_Addr, 0xe7,&cBoardSelStatus);
                           #endif
 159   2                    #ifdef DATABUS
 160   2                  cBoardSelStatus=ReadyAlert;
 161   2                    //Delay();
 162   2                  #endif
 163   2                  //printf("FPGA board status = %bd\n",cBoardSelStatus);
 164   2                  
 165   2                   if((cBoardSelStatus&0x01)==1)
 166   2                        cBoardSel =0;
 167   2                   else if((cBoardSelStatus&0x02)==2)
 168   2                          cBoardSel=1;
 169   2                   else 
 170   2                         cBoardSel =2;
 171   2                     //printf("FPGA board status = %bd\n",(BYTE)bBoardBStatus);
 172   2                     //printf("FPGA board status = %bd\n",(BYTE)bBoardAStatus);
 173   2                   if(cBoardSel==1||cBoardSel==0)
 174   2                      {
 175   3                         #ifdef IIC  
                              dvRegisterWrite(IIC_FPGA_SLAVE_Addr, 0xe8, 0x00); 
C51 COMPILER V7.50   MAIN                                                                  01/17/2007 18:28:55 PAGE 4   

                               #endif
 178   3                         #ifdef DATABUS
 179   3                         DisplayLED=0x00;
 180   3                       
 181   3                       #endif
 182   3                       FPGABoardSelect(cBoardSel);
 183   3                        printf(" board select %bd \n",cBoardSel);
 184   3                        PinDetectStatus = P1;
 185   3                       for(i=0;i<4;i++)  //select Gx board
 186   3                              { 
 187   4                                if(PinDetectStatus&(1<<(1+i)))
 188   4                                {
 189   5                                 printf("Gx board %bd :UOC is not  bus off\n",i);
 190   5                                 printf("Gx board %bd set fail\n",i);
 191   5                                 continue;
 192   5                                }
 193   4                                
 194   4                                  bTimeStatus =TRUE;
 195   4                                  GxBoardLEDSet(i,1);
 196   4                                  GxBoardSelect(i);
 197   4                                  printf("select Gx board %bd\n",i);
 198   4                                   GxADCTestSet();
 199   4                                   TestSignalSet(0);
 200   4      
 201   4                                              for(j=0;j <2;j++)  //select input format
 202   4                                                {
 203   5                                                              if(!bTimeStatus) break;
 204   5                                                       //printf("select Format %bd\n",j);
 205   5                                                         InputFormatSelect(j);
 206   5                                                        GxInitial(j);
 207   5                                                        #ifdef Debug
 208   5                                                         EEPROMUocSettingGet(j);
 209   5                                                         #endif
 210   5                                                           
 211   5                                                      for(t=0;t<3;t++)  //select Channel
 212   5                                                              {
 213   6                                                                if(t==0) k=1;
 214   6                                                                else if(t==1) k=0;
 215   6                                                                else  k=2;
 216   6              
 217   6                                                           RGBChannelSelect(k);
 218   6                                                                 if(j==1&&(k==0||k==2))
 219   6                                                                 {
 220   7                                                                     TestSignalSet(1);
 221   7                                                                     GxGainSet(k,0xff);
 222   7                                                                     wRefOffset=RefOffsetGet();
 223   7                                                                      printf("Gx board =%bd,InputFormat=1,channel %bd  get real time offset =0x%4x!\n
             -",i,k,wRefOffset);
 224   7                                                                    RefGainSet(RefGainSetting[j*3+k]);
 225   7                                                             RefOffsetSet(wRefOffset);
 226   7                                                             TestSignalSet(0);
 227   7                                                                 }
 228   6                                                                 else
 229   6                                                                 {
 230   7                                                                  RefGainSet(RefGainSetting[j*3+k]);
 231   7                                                           RefOffsetSet(RefOffsetSetting[j*3+k]);
 232   7                                                                }
 233   6                                                              bTimeStatus = CalibrationProcess(i,j,k);
 234   6                                                         if(!bTimeStatus) break;
 235   6                                                               if(bTimeStatus)
 236   6                                                               GxEEPROMWrite(j);
 237   6                                                    
C51 COMPILER V7.50   MAIN                                                                  01/17/2007 18:28:55 PAGE 5   

 238   6                                               }
 239   5                                    if(bTimeStatus)
 240   5                                      {
 241   6                                      GxBoardLEDSet(i,3);
 242   6                                      printf("Gx board %bd set successfull\n",i);
 243   6                                      }
 244   5                                    else
 245   5                                      {
 246   6                                        GxBoardLEDSet(i,2);
 247   6                                      printf("Gx board %bd set fail\n",i);
 248   6                                      }
 249   5                                    
 250   5                                }
 251   4                    
 252   4                        FPGABoardClear(cBoardSel);
 253   4                      }
 254   3              }
 255   2         } 
 256   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1034    ----
   CONSTANT SIZE    =    353    ----
   XDATA SIZE       =   ----      15
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       3
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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