1 / 20

D0 CFT AFE Module

D0 CFT AFE Module. Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik. VB_Writew. Function VB_Writew(Address As Long, lValue As Long) As Integer Dim i As Integer i = writevmeli (Address, lValue) VB_Writew = i End Function.

cachez
Download Presentation

D0 CFT AFE Module

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. D0 CFT AFE Module Phase V Test Stand VBA Based Control Code PPD / EED VBA Class Session III May, 18 2004 M. Matulik

  2. May 18, 2004

  3. VB_Writew Function VB_Writew(Address As Long, lValue As Long) As Integer Dim i As Integer i = writevmeli(Address, lValue) VB_Writew = i End Function May 18, 2004

  4. InitializeSASEQ Static Function InitializeSASEQ(lHDIEnable As Long) As Integer 'Performs the operation of initializing the SASEQ. This results in the SVX chips being placed 'into initialize mode, ready for downloading. In addition, the parameter passed to this procedure 'is used to control the HDI enable bits (controls the output enables on the transceiver(s) connected 'to the SVX control and data busses). ' 'This sequence was copied from the SASEQ initialization list processor worksheet ' 'Required modules: io_617.bas or equivalent ' 'Compiled: M. Matulik Dim iPlace As Integer Dim lAdd As Long Dim lVal As Long InitializeSASEQ = 0 iPlace = VB_clrlatcherri ' clear the latching bit3 status error flg ' Write to SASEQ CROSSWID register lAdd = lSASeqBaseAdd + 6 '0x50D006 lVal = 48 '0x30 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ CALVOLT register lAdd = lSASeqBaseAdd + 8 '0x50d008 lVal = 0 May 18, 2004

  5. InitializeSASEQ lVal = 18 '0x12 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ PCID register lAdd = lSASeqBaseAdd + 12 '0x50D00C lVal = 208 '0xD0 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ IGNORE register (controls HDI enable) lAdd = lSASeqBaseAdd + 18 '0x50D012 lVal = lHDIEnable '0x03 enable HDI on chain 1 and 2 '0x12 ignore chain 1, enable HDI on chain 2 '0x21 ignore chain 2, enable HDI on chain 1 '0x30 ignore both chains, disable HDIs on both chains iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ CSR lAdd = lSASeqBaseAdd + 14 '0x50D00E lVal = 166 '0xA6 iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ TRIGGER register lAdd = lSASeqBaseAdd + 24 '0x50D018 lVal = 0 ' set 132ns mode iPlace = VB_Writew(lAdd, lVal) ' Write to SASEQ TRIGGER register lAdd = lSASeqBaseAdd + 24 '0x50D018 lVal = 128 '0x80 set idle mode iPlace = VB_Writew(lAdd, lVal) May 18, 2004

  6. InitializeSASEQ If VB_islatcherri = 0 Then 'No VME errors detected Else InitializeSASEQ = 1 iErrorCode = iSaseqError iTestCode = iSaseqInit iChannelNumber = -1 sErrorValue = -1 iBoardHanded = -1 Call SortErrors End If End Function May 18, 2004

  7. May 18, 2004

  8. Scope of AFE Test Stand Code • Trivial user entry • Entry error checking. • Verify Test Stand Hardware Functionality • Complete Test of AFE Module • Verify 1553 Communication Path. • Verify the Functionality of the FIFO. • Verify Revision Level of Micro Firmware. • Download VSVX CPLD parameters. May 18, 2004

  9. Scope of AFE Test Stand Code • Complete Test of AFE Module • Download SVX parameters. • Perform VRef Sweep to determine operating point for each of the 32 SIFT chips on the AFE Module. • Use these operating points for subsequent Data Collection. May 18, 2004

  10. Scope of AFE Test Stand Code • Complete Test of AFE Module • Perform Data Collection Routine. • Write test specific values to registers on AFE Module and AFE Test Module. • Obtain Digitized Mean and Discriminator Occupancy for all channels. • Perform VLPC Bias Voltage and Cryogenic Temperature Control Tests as necessary. May 18, 2004

  11. Scope of AFE Test Stand Code • Complete Test of AFE Module • Analyze Channel Data for Correct Values of Discriminator Occupancy and Digitized Mean. • Three types of AFE Modules can be tested with different expected Mean values. • Generate ACSII files listing results of tests just completed, appending to files of previous test results. May 18, 2004

  12. Scope of AFE Test Stand Code • Save raw data of test results to ASCII files for off-line, more extensive data analysis. May 18, 2004

  13. May 18, 2004

  14. May 18, 2004

  15. May 18, 2004

  16. Phase V AFE Test Stand VBA code • Collaborative effort, 5+ people writing code. • Highly modular – each code writer responsible for syntax within own module(s). • Pass variables to called functions. • Use of global variables across all modules. May 18, 2004

  17. Phase V AFE Test Stand VBA code • Code sections freely stolen from existing/running VBA code, modified to utilize globally defined variables. • Each imported module was required to compile without errors – each code writer was given the most recent copy of the code. • Logic errors corrected during debug. May 18, 2004

  18. Phase V AFE Test Stand VBA code • What did we wind up with? • A lot of code. • A lot of experience. • A functioning set of code. • A useful base for generating diagnostic programs. May 18, 2004

  19. Phase V AFE Test Stand VBA code • What would we change? • Don’t rely as much on global variables. • Insist on a more common coding style from all of the programmers. • Take more time up front to optimize subroutine and function operation. May 18, 2004

  20. When you have problems: • Verify logic. • Check passed variables. • Call 2554. May 18, 2004

More Related