Testing Readout Cards

From MCEWiki

This test plan is valid for Rev. B/C/D/E Readout Cards.

Setup

The following equipments are needed:

  • mas PC: An ubuntu-based PC with ARC-64 PCI card installed an running mas software.
  • 2-slot backplane with Clock Card plugged in: Device under test (DUT) is plugged into this backplane during testing.
  • fibre-optic cable: connects mas-PC to Clock Card.
  • set of Linear supplies to power up the cards. (3V, 4.5V, 6.2V, -6.2V)
  • Altera USB programmer: attached to the JTAG connector in Clock card front panel.
  • PC with Quartus installed: used to program FPGA and configuration devices on Readout Card.
  • Oscilloscope

If you have all the above and if your DUT has already been smoke tested, you are ready to start:

  1. connect them up an power up the 2-slot backplane.
  2. Load FPGA firmware using Quartus. Firmware is located at http://www.phas.ubc.ca/~mce/mcedocs/firmware . Run auto-detect and you should see 3 to 4 devices depending on the revision of the card you are testing. The part at the bottom of the list corresponts to Clock card FPGA. Load following firmware from the above directory: CC firmware 5.0.7, and RC firmware rc_stratixIII_v05020000_28may2013.sof for Rev. C/D/E cards and rc_5.1.0_01nov_2010 for Rev. B cards.
  3. On the 2-slot backplane there are two sets of dip switches. You need to set the one on the Readout card side to 1011 (0xB), otherwise rc1 replies do not come back, because the card is not identified properly.
  4. When the fibre pair is plugged in with the correct orientation, the red led on the clock card has to be off.
  5. Now make sure both cards communicate with the PC. ssh to the PC running mas and connected to the 2-slot backplane trhough fibre cables and run the following command:
 mce_cmd -x rb cc fw_rev

and you will see:

 Line   0 : ok : 0x5000007

and then type:

 mce_cmd -x rb rc1 fw_rev

and you will see

 Line   0 : ok : 0x5010000

Testing General Features (card_all_test)

We run a scrip on the mas PC to issue commands over the fibre to test the Readout Card unit under test. In this script, the following circuits are tested: LEDs, silicon ID chip, slot-id and pcb-revision identification pins, FPGA and board temperature sense circuitry, LVDS communication pairs.

On mas PC, type: card_all_test

The output should look like:

 ****** Check to make sure the LEDs on the target card switched status! ****
 Unit Under Test  :  rc1
 Serial Number    :  SRC-216
 Firmware Revision:  -0xfffa
 card_id          :  0x20be502
 slot_id          :  [4]
 card_type        :  [2]
 card_rev         :  0
 fpga_temp        :  34 C pass
 card_temp        :  28 C pass
 results are in   :  /data/cryo/current_data/SRC-216_1285959943_all_test

copy the results into the test logfile and record the card_id on MCE CARD Serial-Number Lookup.

Testing DACS: sa_bias, offset, and sq1fb DACS (rc_test)

In this stage, we test the serial and parallel DACs. Serial DACs are 16-bit and are used to set the sa_bias and offset parameters of the Readout Card. Parallel DACs are 14-bit and are used to set the SQ1_fb. On mas PC, run rc_test:

When the rc_test script is run, DACs are loaded with a set of fix values and then a ramp is applied and outputs need to be probed in all cases.

For serial DACs, the script only tries loading 3 values: 0, midrange, full-range. DAC outputs need to be measured at TP1 and TP2 locations on board. Here is a PASS criteria for the serial DACs. A similar table needs to be included in the test log.

Output 0x0000 0x8000 0xffff 0-2.5V Ramp
sa_bias (TP1) +-100mV 1.25V +-10mV 2.5V +-10mV OK
offset (TP2) +-100mV 1.25V +-10mV 2.5V +-10mV OK


For parallel DACs, however, a set of walking-1 pattern on LSB bits along with 0, midrange and full range is examined. The rational is that a short among lower-significant bits may not be visible in a ramp test.

DAC outputs need to be measured on 2-slot backplane connector. Here is a PASS criteria for the parallel DACs. A similar table needs to be included in the test log.

Output 0x0000 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x3fff 0-1V Ramp
S1_FB_CH0 0.083 mV 0.150 mV 0.189 mV 0.326 mV 0.557 mV 1.030 mV 1.968 mV 0.96494 V OK


Testing Serial Configuration device and FPGA reconfiguration

Load firmware into the configuration device as oppose to the FPGA now. Rev. B cards have a parallel configuration device (EPC16) and Rev. C/D/E cards have a serial configuration device. So follow the set of instructions below that applies to the board you are testing:

Programming Serial Configuration Device

The serial configuration device is programmed through the FPGA by loading a jic file. Here are the steps:

  • Run Quartus programmer and click on auto-detect. You should see 3 devices in the list.
  • Select ep3s50 device and click on change file to choose rc_stratixIII_v05020000_28may2013.jic (found in www.phas.ubc.ca/~mce/mcedocs/firmware)
  • When you choose the jic file, you will see that now an entry is added to the list. The serial configuration device has no direct jitag access and is only accessible through the FPGA and hence it is shown as dotted lines connected to the ep3s50.
  • Now select both devices (the two on top) and click on program.

Programming Parallel Configuration Device

  • Run Quartus programmer and click on auto-detect. You should see 4 devices in the list.
  • Select the top epc16 device and click on change file to choose rc_v05010000_01nov2010.pof (found in www.phas.ubc.ca/~mce/mcedocs/firmware)
  • Now select the device and click on program.

Verify programming

  • When programming is done, turn off the power and turn it back on. If the Green Light is on, it means that you have successfully programmed the serial device.
  • on mas prompt, type: mce_cmd -x rb rc1 fw_rev and you should see the firmware revision of the firmware you loaded. This is usually noted in the filename of the file you chose.

Record the result in logfile.

Preamp and ADC Step-Response Test (not complete yet)

This test routes the outputs of each preamp chain and ADC to the equivalent Feedback-DAC for a fast check on preamp chain and ADC operation, and preamp rise/fall-times and overshoot.

Firmware: rc_noise_response_test_24apr2006.sof

Equipment: HP3312A Function Generator, special 50 ohm terminated test cable, TDS3034B or TDS3054B oscilloscope.

Set the scope Measure functions to display frequency, rise-time, fall-time, and amplitude. Adjust the function generator for a square wave output at a frequency of about 800kHz, with the amplitude about mid scale on the lowest range [.01]. Connect the function generator to the preamp channel input pins on the 2SlotBP header and monitor the feedback DAC output on the 2SlotBP header with a scope. Adjust the signal amplitude and offset to about 0.5 volts p-p, centered in the DAC output range. Note: the function generator offset control does not have enough range, when using the 50 ohm terminated test cable, to adjust the offset so that the top of the square wave above about 0.7 to 0.8 volts [as viewed at the FBDAC output]. If you want to test the full range of the ADC-FBDAC combo, use the unterminated test cable.

For each preamp chain in turn connect the signal generator and check the DAC output as above. Using Internet Explorer, open the scope URL, and save the scope output as a xxx.bmp file. Log the file name, as a record of signal chain and DAC functioning. Also log any anomalies seen.

Note: if you want to do a noise FFT on the output data, use a shorting or 49R9 jumper-terminator instead of the signal generator. The scope output can be saved as an xxx.isf file, which can then be read by ‘power_spectrum.sav’, an IDL program. [There is a shortcut icon for this program at the top of the TestBench PC monitor].

Channel Noise Histogram Test (rc_noise_test_histogram)

In this stage, the pre-amp chain and the ADC of each channel are tested while a 50-Ohm load is attached to the input of the preamp chain. A set of 50MHz data is acquired from each channel, the rms is calculated and a histogram plot is generated. Since the input is 50-Ohm grounded, the historgram is pretty much Gaussian and the the rms should be < 6 for Rev. B Readout cards and < 5 for Rev. E cards.

To run the test, use an MCE subrack and a 50-Ohm termination board plugged into the MDM connector that corresponds to the Readout Card under test. Connector P2 on subrack corresponds to RC1, P3 to RC2, etc. Then, on mas prompt type:

rc_noise_test_histogram
Usage:
  /usr/mce/mce_script//test_suite/rc_noise_test_histogram [-a] [-r #] [-c #] [-n #] CARD_ID
where:
  CARD_ID the serial number of the readout card to test.
  -a      acquire data (otherwise, assume data already exists in $MAS_DATA/CARD_ID)
  -r RC   readout card # (1,2,3,4) default=1; ignored if -a not specified
  -c CH   channel # (0,1,2,3,4,5,6,7) default= (all channels)
  -n NF   number of files with 65000 samples each (default is 10)
 A directory called CARD_ID_<ctime> will be created under $MAS_DATA.  All data
 will be acquired to this directory.

For example:

rc_noise_test_histogram -a SRC_204
ch 0 with stdev 5.267597
ch 1 with stdev 5.397718
ch 2 with stdev 5.239349
ch 3 with stdev 5.374495
ch 4 with stdev 5.288242
ch 5 with stdev 5.354037
ch 6 with stdev 5.330049
ch 7 with stdev 5.188404
All channels passed the test.


rms values are printed to the screen and histograms are stored as ps files. Copy the ps files in the test log directory on the server. copy and paste the rms reports into the logfile.