CSM MiniDAQ3.0.0 Quickstart Guide
Contents
1 Introduction to the CSM MiniDAQ and Installation
2 Installation and Starting the CSM MiniDAQ
3
JTAG Programming
4
Acquisition Runs
5 Diagnostic Tools
6 Useful Information
Installation and Build Option:
To install the CSM MiniDAQ3.0.0, first get the MiniDAQ3.0.0 distribution kit from
http://atlas.physics.lsa.umich.edu/docushare/dscgi/ds.py/View/Collection-178/
. Then run the setup.exe where user is able to modify the installation path.
A file <constant.h> is included in the 3.0.0 distributions of CSM MiniDAQ. This file contains build options and parameters that can be changed to reflect hardware upgrades. The main build options are
FIREWIRE
,
PDT_ONLY
, and
ENVIRO_CHECK
. If a FIREWIRE (IEEE 1394) VME interface is in use, the diagnostic menu does not print the VME FIFO correctly unless the line
#define FIREWIRE
is uncommented.
PDT_ONLY
tells the CSM MiniDAQ to use only programmed IO instead of block transfers when collecting data (note: this does not affect the diagnostics panel which uses block transfers). To use block transfers, comment out the line
#define PDT_ONLY
. Finally,
ENVIRO_CHECK
includes support for using an ADC card to take measurements of temperature, pressure, and humidity and also to use these as a feedback control on the chamber. The calibration is specific to the University of Michigan cosmic ray test, but the code can be easily modified to use different ADC and DAC cards. To enable the environment checking software, comment out the line
#define ENVIRO_CHECK
.
Starting the CSM MiniDAQ:
Figure 1. The CSM MiniDAQ main window
If the MiniDAQ is compiled with
DEBUG
mode, the DAQ speed will be reduced significantly. It is always good to build
Release Executable
for normal DAQ.
Before running the CSM MiniDAQ program, make sure that the VME hardware has been initialized with the NI Resource Manager and that all CSM0 Modules are include in the device list. CSM0 Cards require A32 address space with an address that agrees with the address set by the dipswitches on the CSM0 Card.
The CSM MiniDAQ program is started with the file csm0.exe, which brings up the main CSM MiniDAQ window. The program will automatically scan all available CSM0 cards in the VME crate. If only one CSM0 card is found, the card will be used. Otherwise user will be asked to provide additional information (normally BASE address). When user quit the program, several parameters (BASE, run #, # used mezzanine cards, BCID/EVID preset value and BCID rollover) are recorded in the file <DAQpara.txt> which is used by the CSM MiniDAQ program. If default settings are saved by user, the default settings will be loaded.
For normal data acquisition with AMT mezzanine cards, DAQ initialization could be performed by simply hitting the
button at first. All of the necessary commands to modify the AMT mezzanine card settings are in the JTAG pull-down menu, including the JTAG diagnostic panel. The mezzanine card setups can be saved and be recalled from the File menu. Once JTAG programming is finished, standard data acquisition commands are all located on the main window. Diagnostic tools are located in BoardTest pull-down menu for CSM0 board functionality tests, in JTAG pull-down menu of “Diagnostics” for JTAG tests and in the Execute pull-down menu of “Diagnostic Run” for data acquisition diagnostics.
Use Help pull-down menu to obtain online help for command buttons and menu items. After select the menu item Help on Buttons, click on any wanted command button or menu item, where a brief description of the item functionality will be popped out for user to view.
3 JTAG Programming
3.1 Connecting the hardware
JTAG protocol requires all devices on the JTAG chain to be in series to work properly. There are two kinds of adapter boards used with the AMT-1 cards. The 4-channel adapter boards have jumpers that determine if a port to a mezzanine card is skipped or connected in series with the next port in the chain. Placing the jumper on the pins farther from the edge of the board includes the associated mezzanine card in the series connection; placing the jumper on the pins closer to the edge skips the mezzanine card. The 18-channel adapter card automatically includes each device plugged into it in the JTAG chain. The leftmost device on the 18-channel adapter card is the first device in the chain. The rightmost device on the 4-channel adapter card as seen from the card edge with jumpers is the first device in the chain. There are two JTAG ports on the CSM0 Module, JTAG IN and JTAG OUT. For the 4-channel adapter card, JTAG IN should be connected to JP1. JTAG OUT should be connected to JP3. The ports should be labeled on the 18-adapter board, but the left port is JTAG IN, the right port is JTAG OUT.
Be sure the power is applied before starting JTAG programming.
3.2 JTAG Menu
The AMT mezzanine cards are programmed through their JTAG port connections by using the JTAG pull-down menu as shown in the right picture. Also diagnostics tool has been provided and will be discussed later. Loading an individual mezzanine card (Setup Individual) is enabled only after mezzanine cards have been initialized with common settings.
·
Mezz. Connection Map provides a way for user to map the mezzanine card connections with CSM0 input channels (TDCs) automatically or manually. The mezzanine card ID is assigned by using following rules: 1) If mezzanine card connection map is provided, the TDC’s number will be assigned as mezzanine card ID. 2) Or if the number of enabled TDCs is same as the number of mezzanine cards, the first mezzanine card in JTAG serial chain has ID as the first enabled TDC’s number and second mezzanine card in JTAG serial chain takes the second enabled TDC’s number as its ID and so on. 3) Neither above two cases, it is assumed that first mezzanine card in JTAG serial chain is connected to CSM0 Channel 0, second mezzanine card in JTAG serial chain is connected to CSM0 Channel 1 and so on, and corresponding TDC’s number is assigned to mezzanine card as its ID. Therefore it is implicitly required to connect the JTAG cables serially in the same order as they are plugged into the RJ45 jacks of CSM0 board if no mezzanine card connection map is provided. Figure 2 shows an obtained mezzanine card connection map by using Mezz. Connection Map, where the mezzanine card number is the sequent number starting from 0 in the JTAG serial chain. Pushing
button will restart mapping the mezzanine card connection between mezzanine cards and CSM0 input channels. A valid map is indicated by
as shown in Figure 2, where the first mezzanine card is connected to CSM0 channel 17 (TDC 17) and second mezzanine card is connected to CSM0 channel 4 (TDC 4).
Figure 2. The CSM Channel and Mezzanine Card Connection Map Window
Pay Attention:
If mezzanine card connections are manually mapped or connection map has been changed, it is user responsibility to make sure that individual mezzanine card settings are right and to program mezzanine cards correctly.
·
Setup All (Ctrl-A) will call mezzanine card setup panel where user is allowed to modify the settings before they are downloaded to mezzanine cards. All mezzanine cards are programmed to the same settings.
·
Setup Individual will let user to select individual mezzanine card to be programmed.
·
Setup Send (Ctrl-S) will program mezzanine cards without any modification to the settings. First all mezzanine cards are downloaded with common settings, then each individual mezzanine card is downloaded with its own settings if it has been programmed individually.
·
Change # Mezz. Cards allows user to change number of mezzanine cards in JTAG chain. Setup send will be called after the change.
·
Diagnostics provide tools to view mezzanine card settings and to test JTAG connections of mezzanine card.
·
Set JTAG Clock Rate sets the TCK JTAG clock rate. Each increase in the value of the clock rate setting is an additional factor of two slower than the base clock rate of 20MHz (JTAG clock rate = 0) if 40MHz clock is used by CSM0. If the JTAG clock rate divisor is smaller than default value of 3, the JTAG may not work properly.
3.3 Program AMT Mezzanine Cards Using JTAG Menu
It is important for user to gives correct number of AMT mezzanine cards in the JTAG chain in order to program them correctly. The AMT mezzanine cards settings can be programmed via JTAG menu, where JTAG
ŕ
Setup All is for common settings and JTAG
ŕ
Setup Individual is for individual settings.
Applying individual setting to mezzanine card:
Applying individual setting to mezzanine card:
Once a common setup has been applied to the attached mezzanine cards, any given AMT card can be individualized. To program an individual mezzanine card, select JTAG
ŕ
Setup Individual
ŕ
Mezzanine N, where N is the assigned mezzanine card ID. The individual setup panel is virtually identical to the common setup panel. If a profile was loaded with an individualized setting for a card, the panel corresponding to that card will hold the saved values. If there is any individualized mezzanine card settings, it is necessary to download individualized settings by issuing a Setup Send after the Setup All is applied.
Figure 3. The Mezzanine Card Setup Window
The JTAG
ŕ
Setup All and JTAG
ŕ
Setup Individual will bring up an AMT mezzanine card setup window shown in Figure 3 (from JTAG
ŕ
Setup All), which contains switches, selection boxes and command buttons. The AMT Error Control Window (Figure 4) is invoked by clicking
.
Figure 4. The AMT Error Control Window
Each mezzanine card contains 24 channels which could be individually turn on/off by clicking on desired channel. Also each mezzanine card has three ASD chips which are programmable. The buttons of
,
and
access the corresponding ASD setup window as shown in Figure 5 (example for ASD1).
Figure 5. The ASD Control Window for Mezzanine Card
Each ASD controls 8 calibration channels which can be turned on/off individually. In normal DAQ runs, ASD channel mode should be turned to Active mode. For detailed ASD programmable parameters, please see reference [5].
saves the current mezzanine card settings to a text file.
recalls the mezzanine card default settings and
closes the setup windows and reverts to previous settings. The mezzanine card settings are applied after the
button on the Mezzanine Card Setup Window is selected.
If mezzanine card settings are individualized, it is recommended to issue JTAG
ŕ
Setup send after mezzanine card settings have been programmed, which ensures the proper programming parameters for each mezzanine card.
All the mezzanine card settings are read back via JTAG and are compared with original setup array. If any error is detected, programming information Panel will be popped out automatically where the failed mezzanine cards will be shown. Also the mezzanine card setup status is shown in the CSM MiniDAQ Main Window. All of the AMT and ASD settings are explained in Appendix C, for more detailed information please refer to the AMT manual [2] and ASD manual [5], [4]. For most applications, the default values should be sufficient. The values that will need the most tweaking are Trigger Offset, the Mask Window, Search and Match Windows in Mezzanine Card Setup Panel, Main Threshold and Chip Mode in ASD Control Panel.
3.4 Profile: Save and Download Setups
The JTAG settings can be saved into a profile for future usage, and it can be done by using File pull-down menu. Select File
ŕ
Save Profile to save current settings into a profile. This will bring up a file open dialog and display files with file extension .prf (profile), where user could provide a new file name or pick up an existing profile to overwrite it, and the current JTAG settings will be saved into the given file. Similarly to load a saved profile, select File
ŕ
Load Profile (Ctrl-L). This will bring up a file open dialog and display files with file extension .prf (profile). After selected profile is loaded, user will be asked whether to download the mezzanine card settings if number of mezzanine card in saved profile is not zero, a YES confirmation will enable the JTAG and download the mezzanine card settings to the hardware. An answer of NO implies that user will download mezzanine card settings later.
A file <default.prf> which contains standard settings is included with the CSM MiniDAQ, but these settings will need to be modified for the particular hardware. To save the mezzanine card settings for reuse, select File
ŕ
Save Profile that brings up a file open dialog. User could provide a new file name with file extension .prf or pick up an exist profile to over write it. A saved profile contains both the common and the individual mezzanine card settings.
Also a default profile could be saved by using “File
ŕ
Save Profile as Default”, where the current JTAG settings are saved into a file <default.prf> and the file <default.prf> would be used as default JTAG settings in the future. To clear a default profile, it is better to do it through “File
ŕ
Clear Default Profile”.
3.5 Copy Mezzanine Card Settings
There is a command button
in the mezzanine card setup window as shown in Figure 2. It brings up the copy mezzanine card setup window as shown in Figure 6 and it allows user to copy mezzanine card settings between mezzanine cards. The command button
is disabled if there is only one on no mezzanine card for obvious reason.
Figure 6. The Copy Mezzanine Card Setup Window
Be copied mezzanine card is selected from selection box of
From
,
and destinations are a group toggle buttons. The main threshold, AMT channel mask and ASD channel mask are controllable, therefore user can decided whether to copy them. If the mezzanine card settings are copied, it is assumed that those mezzanine cards settings is individualized. To start copy mezzanine card settings, click on
button and click on
to exit from the copy mezzanine card setup window.
4 Acquisition Runs
To collect data, the right PROM in CSM0 daughter card should be used, where the XILINX and TTCEM version number is 0x5005 (Hexadecimal) or higher. If AMT mezzanine cards are used, the first step in a data acquisition is to download mezzanine card settings by using JTAG menu. If Demo boards (Emulator cards) are used, the reset button on Demo boards should be pushed before taking data.
Data acquisition is handled from the main CSM MiniDAQ panel, following steps involved in the run of data collection:
1. Select wanted CSM0 input channels if it is not done yet;
2. Modify run setups as user wishes, such as Auto Run Setup, Get BCID Preset Value, Data Monitor Controls and Storage Selection;
3. Initialize DAQ if necessary;
4. Begin the run and accumulate data;
5. End the run if automatically stopping run is not enabled.
4.1 CSM Input Channel Control (TDC Enable and Control)
To select wanted CSM0 input channels, click
on the main CSM MiniDAQ panel brings up the TDC Enable and Control panel as shown in Figure 7.
Figure 7. The TDC Enable and Control Window
To enable or disable an individual CSM0 input channel, click on TDC button where TDC number is the CSM0 input channel number. A green TDC button
indicates that the CSM0 input channel is selected and a red TDC button
indicates that the CSM0 input channel is disabled. If mezzanine card connection mapping has been done, click on button
will enable all CSM0 input channels which are connected to mezzanine cards.
If a connected CSM0 input channel is not enabled, the CSM0 will not expect to receive data from that input channel and will ignore any data from that CSM0 input channel. The TDC enable and Control panel is used to turn on or off the entire CSM0 input channel, therefore an unselected TDC will block all the data to that CSM0 input channel. To turn individual channel on/off for each mezzanine card, use JTAG menu as discussed in Section 3 JTAG Programming. If unconnected CSM0 input channels are enabled, it will hang the data acquisition system while the CSM0 is waiting for data from un-existing cards. User also is able to change trigger FIFO and WC FIFO limits which are maximum number of allowed events. For normal operations, it is sufficient to enable the desired TDCs and then push
button. The TDC Enable Mask
on the CSM0 MiniDAQ Main Window indicates the CSM0 input channel selection, where 1/0 indicates on/off of the corresponding CSM0 input channel.
4.2 Run Settings
Before starting a new run, user has to decide whether to change the run settings for data acquisition, such as data storage, auto run setup and whether to monitor data etc. This section will discuss this in detail.
Storage Selection:
Figure 8. Storage section of the CSM Main Window
To select data storage, use the Storage pull-down menu as shown in Figure 8. There are two main choices, either discard acquired data (select None) or store data into a disk file (select Disk). If Disk is selected, data will be stored in the file indicated by
. There are two options for save data into a disk file:
1. Disk (Auto Generated Filename) will automatically generate file name as run########_yyyymmdd.dat, where ######## is run number, yyyy is year, mm is month and dd is date, this option is recommended.
2. Disk (User Defined Filename) will let user to give a file name. The storage file can either be selected using the BROWSE button (which will bring up a standard windows file selection window) or the file name can be edited directly in the
window. And the file will be checked to see if it is already in disk to avoid overwriting existing file after start the run.
The run number will be automatically incremented by one for new run if Disk option be selected, otherwise run number will stay as same. If auto restart run has been set, it is recommended to use Disk (Auto Generated Filename) if user wishes to save data into disk file. Select Disk (User Defined Filename) in auto restart run mode will result in overwrite data file.
Auto Run Setup:
To bring up auto run setup panel as shown in Figure 9, use Execute
ŕ
Auto Run Setup on CSM main panel. User can turn on/off each setting by clicking on corresponding ON
/OFF
toggle button. Also if individual setting number is modified, it is assumed that user wants to turn on that setting. Each setting is explained following:
Figure 9. Auto Run Setup Window
·
Stop at Event (Default = 4294967295):
Stop run after accumulated required number of events.
·
Restart at Event (Defaul = 100000):
Start a new run after collected required number of events.
·
Restart After xx Seconds (Default = 4294967295):
Start a new run after certain DAQ time.
·
Restart After DAQ Hang(s) (Default 30):
Start a new run after DAQ hang for certain time (s = seconds, number is time, therefore default is 30 seconds).
·
ResetDAQ at Event Error (Default 100):
Reset DAQ after observed required number of event error.
·
Save Registers after DAQ Hang:
Read and save all CSM0 registers into a file after DAQ hang if it is enable. The file name is <***_register.log>, where *** is the data file name without “.dat”. This is useful to trace the causes of DAQ hang.
·
Stop after # of Errors (Default 1):
Stop run after observed required number of event error.
·
Select Automatic Run Control File:
Select control files for automatic runs. For more information about automatic run control file see section 6.3 “Automatic Run Control File”.
After finish the auto run setup, just click
button.
Get BCID Preset Value:
To get a BCID preset value, use Execute
ŕ
Get BCID Preset Value in CSM Main Window. It will automatically calculate the CSM0 BCID preset value and this works both for AMT mezzanine cards and Demo boards. Of course, different type boards should not be used at same time, otherwise CSM0 BCID preset value would not be obtained. If a valid BCID preset value is obtained, user is asked whether to enable CSM0 BCID match testing. Enable CSM0 BCID match testing may result in DAQ hang or data abortion in CSM0 if there are BCID mismatch. User is encouraged to use Execute
ŕ
Get BCID Preset Value to obtain the CSM0 BCID preset value without enable CSM0 BCID match testing where BCID will be monitored by online data analysis. This will give additional validation of AMT mezzanine cards. To disable BCID online monitor, user first has to enabled the BCID match testing at CSM, then use Execute
ŕ
Disable BCID Match.
Data Monitor Controls
Figure 10. Data Monitor Controls on the CSM Main Window
It is always good to take data with online data monitor which is also a useful diagnostic tool. There are two toggle buttons to control data monitor as shown in Figure 10, one for DAQ information, such as DAQ rate, event size and data flow rate as shown in Figure 11,
Figure 11. DAQ Information Window
and another for the data quality checks. Both of DAQ information and data analysis are enabled by default. User could turn them on or off at any time, even during data taking by just click on the corresponding button. If DAQ rate is more than 4KHz, enable DAQ monitor has significantly impact on the DAQ rate.
The DAQ rate, event size and data flow rate are numerically and graphically displayed in DAQ information window. And DAQ time is shown also. By default, the current run DAQ plots are displayed, the most recent 15 minutes DAQ plots can be displayed by clicking on
button. The background color has following means (not for DAQ plots): green
indicates OK, red
indicates error, yellow
indicates a warning or run in pause and magenta
indicates old values.
Figure 12. Data Monitor Error Report Window
If data analysis is enabled, the data will be monitored and checked. If any error is found, data monitor error report window will be automatically popped out as in Figure 12. It is assumed that user wishes to close the data monitor error report window for rest of the run if user clicks on
button. User can bring up the data monitor error report window by using Execute
ŕ
Data Error Report at any time. The background color has following means: green
= OK, red
= error, yellow
= warning and black = not checked.
·
# Event With Error:
number of events with error(s);
·
# Word Counter Error:
number of word counter errors where number of expected data words (from WC/BCID register) is not agree with number of received data words;
·
# CSM BCID Error:
number of BCID mismatch in CSM header;
·
CSM WordCount Error:
number of word counter error in CSM trailer;
·
# BCID Mismatch:
total number of BCID mismatch;
·
# EVID Mismatch:
total number of EVID mismatch;
·
# Empty Event:
number of events with zero data word;
·
# WC EVID Mismatch:
total number of Word Counter EVID mismatch (does not agree with expected EVID which is previous event number + 1
modulated by 4096
);
·
# Extra Words:
number of unexpected data words;
·
# CSMhdr EVID Error:
number of EVID mismatch in CSM header;
·
# CSMtrl EVID Error:
number of EVID mismatch in CSM trailer;
·
# CSMabr EVID Error:
number of EVID mismatch in CSM abort;
·
# CSM Error:
number of CSM error words;
·
# CSM Abort:
number of CSM abort words;
·
Missing CSM Header:
number of events without CSM header;
·
Extra CSM Header:
number of events with more than 1 CSM headers;
·
Missing CSM Trailer:
number of events without CSM trailer;
·
Extra CSM Trailer:
number of events with more than 1 CSM trailers;
·
# TDC Error:
number of TDC error words;
·
# Empty TDC Error:
number of empty TDC error words;
·
# Empty TDC Mask:
number of empty TDC mask words;
·
# TDChdr EVID Error:
number of EVID mismatch in TDC header;
·
# TDCtrl EVID Error:
number of EVID mismatch in TDC trailer;
·
# TDC BCID Error:
number of BCID mismatch in TDC header where the BCID is compared between different TDC;
·
# Missing TDC Header:
number of events with less TDC headers than expected;
·
# Extra TDC Header:
number of events with more TDC headers than expected;
·
# Missing TDC Trailer:
number of events with less TDC trailers than expected;
·
# Extra TDC Trailer:
number of events with more TDC trailers than expected;
·
# TDCID ErrIn THD:
number of TDC ID errors (missed or unexpected TDC ID) in TDC header;
·
# TDCID ErrIn TTR:
number of TDC ID errors (missed or unexpected TDC ID) in TDC trailer;
·
# Parity Error Word:
number of CSM parity error words.
·
TDC HD After its Data:
number of TDC headers after its data;
·
TDC TR AheadItsData:
number of TDC trailers ahead its data.
·
TDC WC Mismatch:
number of TDC word counter mismatches;
·
Cont. Same Edge
: number of TDC data words which continue with same edge (leading or trailing edge) at leading and trailing edge mode within an event.
·
Unexpected TDC Data
: number of unexpected TDC data word, where unexpected data word is defined as wrong data type as expected. For instance, the leading/trailing edge data word should not be present at pair mode.
·
# Warning Events
: number of events with warning.
·
Wrong TDCtime Order
: number of TDC data words where measured time is not at ascending order.
·
# TDC Edge Error:
number of errors reported by TDC leading/trailing edge word;
·
EdgeErr.
Width<20bin:
number of errors reported by TDC leading/trailing edge word where the measured width is smaller than 20 counter.
·
Evt No TDC Hits:
number of events without any TDC hits.
·
Evt Only TDC Hd&Trls:
number of events only with TDC headers and trailers.
·
# TDC MaskWord:
number of TDC mask words.
·
# TDC Debug Word:
number of TDC debug words.
·
# DAQ Reset:
number of applied DAQ reset during the run.
·
# Error-Forced Reset:
number of DAQ reset due to DAQ errors.
4.3 Starting run and Collecting Data
After hit
button to do a DAQ initialization, a run could be started by just clicking the button
. Few things will be checked, such as event offset (another name EVID Preset Value), BCID Rollover and whether disk file will be overwritten if storage selected as Disk. If any problem is detected, user will be informed and will be asked to make decisions.
The basic DAQ information is displayed in the CSM MiniDAQ main window as shown in Figure 1. The
Run No
shows the current run number and the
Evt No
status box gives the number of accumulated events. To allow for faster data acquisition, multiple events are written into a single buffer that is stored to disk when it is full. The
Buffers
status box shows number of these buffers. Also DAQ time and current DAQ rate are shown. If data analysis is enabled, number of event with error is displayed in status box of
# Error
.
During the run,
and
on the CSM MiniDAQ main window allow user to suspend and resume data acquisition. Once enough events have been accumulated, click on command button
to start the run termination process where the CSM MiniDAQ will ignore any new triggers, read the rest buffered events and flush the last storage buffer into disk. A run log is saved into disk with a file name <***.log> and a hit summary is written into a file with name <***.sum> normally, and an error summary is kept into a disk file with name <***.err> also if data monitor is enabled, where *** is the data file name without “.dat”.
5 Diagnostic Tools
CSM MiniDAQ provides tools for diagnosing the CSM0 hardware, JTAG programming, data acquisition. CSM0 hardware diagnostic tools including the Board Test pull-down menu and Execute
ŕ
Diagnostics Run. JTAG programming has a diagnostic panel that can be used when JTAG serial is enabled through JTAG
ŕ
Diagnostics. The tools for data acquisition can be accessed with Execute
ŕ
Diagnostics. Few useful tools are accessible via Execute pull-down menu.
5.1
Using the Board Test Menu
Board Test pull-down menu provides an easy and quick way to check the functionality of CSM0 VME board and daughter board, which including following tools:
·
Test CSM/Mezz. Board: It will bring up the panel as shown in Figure 13 to test CSM0 VME board and CSM0 Mezzanine Board (another name CSM0 Daughter Board).
Figure 13. Test CSM/Mezzanine Board Window
It first checks whether the CSM0 VME board is functional by looking its
Board ID
and will enable all CSM0 register tests if the
Board ID
is correct. Also it verifies the CSM0 mezzanine board and will enable all CSM0 mezzanine register tests if verification is passed. Click on a desired register test toggle button will enable or disable that register test. It is also possible to enable/disable register tests by group as shown in Figure 13. A green register item
indicates that register test is on and a red register item
indicates that register test is off. If the register passed the test, the corresponding LED indicator will turn to green
, otherwise it stays on red
(register test not passed or not selected). After all the tests have been performed, a test summary will be reported in the
Message
box.
It is worth to point out the test
which checks whether master reset is functional as expected. At first same data word is written to all the CSM0 mezzanine card registers including VME address 96 for JTAG, then a master reset is issued and all used registers are checked against expected value where most of them should be zero. And the test is repeated 1000 times. To perform
test which checks whether the CSM0 receives trigger and flag event ready bit correctly, external trigger must be connected with a trigger rate at least 100Hz.
·
Look Mezz. Card Signals: User is required to check the CSM0 mezzanine card signal period by using scope and to compare it with expected period, where the diagnostic PROM is involved. After the signal has been checked, user need to click on corresponding
Period Status
toggle button if the observed period is same as expected or only corresponding
Check Status
toggle button if the observed period is not same as expected. Figure 14 shows an example to look CSM0 mezzanine card read address 9 to 13 signals. User will be warned if some signals are not checked.
Figure 14. Look Read Address(9:13) Signal Window
·
Measure Received Rate(TDCs off): It brings up the CSM0 Received Trigger Rate window as shown in Figure 15 and measures the CSM0 received trigger rate twice in 30 seconds and 60 seconds respectively, where all TDCs are off. During the rate measurement the time progress bar will be filled seconds by seconds with green
color as measurement proceeding. Because the rate is measured by using computer CPU, any activities of the computer could has significant impact on the measurement, therefore it is better do not touch the computer during rate measurement.
Figure 15. Measure CSM Received Trigger Rate Window
· Loop on Register: It allows user to read/write any VME address with any wanted data and it is also allowed to check read data to expected values, where the corresponding LED will indicate the compared results (green = OK, red = Error). The loop on register panel is shown in Figure 16.
·
Loop on Register: It allows user to read/write any VME address with any wanted data and it is also allowed to check read data to expected values, where the corresponding LED will indicate the compared results (green
= OK, red
= Error). The loop on register panel is shown in Figure 16.
Figure 16. Loop on Register Window
There are three ways to select desired register by its name, address or address given by user. To active wished the way, click on corresponding area and select wanted register or VME address, other two will be automatically in idle mode. Push to start loop and to stop loop, and loop time is also displayed. Exit the loop on register panel by hitting button.
There are three ways to select desired register by its name, address or address given by user. To active wished the way, click on corresponding area and select wanted register or VME address, other two will be automatically in idle mode. Push
to start loop and
to stop loop, and loop time is also displayed. Exit the loop on register panel by hitting
button.
·
Check TDC On/Off Status: It scans through all the CSM0 input channels to see which CSM0 channel could receive data, and the scan results are compared with enabled TDCs, where the software trigger is used. An example is shown in Figure 17 where TDC 4 and TDC 17 are detected to be on. During scan, the scanned TDC number is displayed in
Checking TDC
box. Command
button allow user to rescan all the CSM0 input channels, and
to quit from the panel.
Figure 17. TDC On/Off Status Window
5.2
Using the JTAG Diagnostics Panel
The JTAG Diagnostics panel is brought up by click JTAG
ŕ
Diagnostics, which is useful to check if the CSM0 JTAG port is functional and if the AMT mezzanine boards are configured correctly. Figure 18 is the JTAG diagnostics panel, where the following tools are provided:
·
allows to select mezzanine card by its ID;
·
reads the AMT ID code and compared with expected AMT ID code;
·
performs a global reset to all connected mezzanine cards using the control register of the AMT mezzanine card;
·
reads the status registers of the selected mezzanine card, where the AMT mezzanine card ID follows the ID in
;
Figure 18. JTAG Diagnostics Window
·
shows the selected mezzanine card settings;
·
shows the mezzanine card common settings used by Setup All (see Section 3.2 and 3.3);
·
checks the settings of selected AMT mezzanine card, where the settings are read back and compared with original one. The read back settings are displayed in programming information panel as shown in Figure 19.
Figure 19. Programming Information Window
The number of mismatched bits of the setup array and the number of failed mezzanine cards are indicated in the Programming Information panel. The mezzanine card failure flags and the individualized mezzanine cards are displayed also.
·
checks the mezzanine card common settings used by Setup All;
·
performs loop test on all mezzanine cards at same time with “random” setup array. Figure 20 illustrates the window of loop test on JTAG setup. CSM0 JTAG could be verified decently by performing that test.
Figure 20. Loop Test on JTAG Setup Window
The setup loop tests are done as following: 1) Zero all setup bits and only let 1 setup bit to be one and go through all setup bits (walk one test); 2) Put all setup bits are 1 and only let 1 setup bit be zero and go through all setup bits (walk zero test); 3) With certain fixed setup pattern (fixed pattern test); 4) Using random number generator to get “random” setup array. All loop test results are displayed in the loop test on JTAG setup window, and the failed mezzanine cards are indicated as well. Zooming on the error display plots is allowed and JTAG rate divisor coThe setup loop tests are done as following: 1) Zero all setup bits and only let 1 setup bit to be one and go through all setup bits (walk one test); 2) Put all setup bits are 1 and only let 1 setup bit be zero and go through all setup bits (walk zero test); 3) With certain fixed setup pattern (fixed pattern test); 4) Using random number generator to get “random” setup array. All loop test results are displayed in the loop test on JTAG setup window, and the failed mezzanine cards are indicated as well. Zooming on the error display plots is allowed and JTAG rate divisor could be changed at any time. If JTAG rate divisor is less than 3, most likely JTAG loop tests will be failed.
·
performs loop test on the selected mezzanine card with “random” setup array, test sequence is same as
;
·
performs loop test on all mezzanine cards one by one with “random” setup array, test sequence is same as
;
·
provides a way to perform CSM0 JTAG test without AMT mezzanine card. A straight RJ45 cable is used to connect CSM0 JTAG IN and JTAG OUT directly, where the fixed data patterns are used in the test.
5.3
Using the CSM0 Diagnostic Panel
Execute
ŕ
Diagnostics Run controls the CSM0 diagnostic panel as shown in Figure 21. Due to the fact that user is able to write and read many CSM0 registers by using Global Controls, TTCem Controls and CSM0 Controls menus, and
button, it is a powerful and robust tool for CSM0 board diagnostics. Few examples will be illustrated below. It also can be used to debug the data acquisition problems and will be discussed in more details later.
Figure 21. CSM0 Diagnostic Window
Click on
button, the content of the selected register indicated by the Readback Register will be displayed. And
controls how many times of next operation will be done and it will be reset back to 1 if the next operation is performed. For instance, the Repeat is set as 16 as shown in Figure 21, if
button is pushed, the Board ID in Readback Register box will be read 16 times.
Examples for CSM0 Board Diagnostics
Examples for CSM0 Board Diagnostics
Example 1: Check read-only register
Choose a desired register in Readback Register box to be read, for instance Board ID which should be 0x2332E31. Read that register repeated or read it after varies operations are performed such as Master Reset and read/write registers, the obtained data word should be always kept as 0x2332E31..
Example 2: Check a register that can be written and read
First write a data word to a selected register, a good example is TTCem Controls
ŕ
Set Pipeline, then read that register by selecting it at Readback Register box. The read back value should agree with the written data word, otherwise something is wrong.
Example 3: Check master reset functionality
The Global Controls
ŕ
Master Reset performs a master reset that zeroes most of CSM0 registers. User also can write to varies registers, set DAQ active, and enable serial and diagnostic controls before applying a master reset to the system. After apply a master reset to the system, read back CSM0 registers and check if their value as expected. The master reset will turn control buttons of Set/Clear DAQ Active, Set/Clear Ext Trigger Enable and Enable/Disable Serials to RED
.
For more information of CSM0 registers and pull-down menu of CSM0 diagnostic panel, please see the references [6] and [1].
DAQ Diagnostics
DAQ Diagnostics
Taking data with the diagnostic panel requires that the attached mezzanine cards have been properly programmed using JTAG. Once the system is ready, follow these steps:
1. (Optional) Turn on/off desired TDCs using Trigger Controls
ŕ
Enable TDCs or Ctrl^E.
2. Click on
for event read preparation. It will reset the CSM0 and attached mezzanine cards, set used CSM0 registers and enable selected TDCs, where in default, EVID match testing at CSM0 is enabled and BCID matching test is disabled. It will set DAQ active if any TDC has been selected.
3.
(Optional) Set registers. As an example, disable EVID match testing at CSM0 by using CSM0 Controls
ŕ
Disable EVID Match to get data even the EVID of TDC data received by CSM0 does not match its internal EVID (if EVID match testing is enabled, unmatched event will be discarded by CSM0).
4. Select trigger by clicking on toggle button of Set/Clear Ext Trigger Enable, if user selects
, external trigger will be used. And
means to use software trigger, where user has to issue software trigger by selecting Trigger Controls
ŕ
Software Trigger in Trigger Controls pull-down menu. No more than 16 software triggers can be issued at same time (the repeat counter should be no more than 16), otherwise data error will occur.
5.
Read events: Before reading events, user should decide whether to include decipher of the hex words read from the CSM0 VME FIFO to a more readable form by using switch control Expand FIFO Print, which is Yes at default. Several methods are available for reading the VME FIFO, and user can choose any one to read the VME FIFO. In most case, the block transfer is used in reading VME FIFO if it is not explicitly mentioned.
Trigger Controls
ŕ
Read FIFO All
ŕ
Print will read the EVID/WC register of the CSM0 and grab the indicated number of words and write them to the standard output. If the EVID/WC register is empty, the CSM0 either did not receive a trigger, or is waiting for a missing header or trailer from enabled input cards.
Trigger Controls
ŕ
Read FIFO All
ŕ
No Print has same reading sequence as previous one. And only the content of EVID/WC will be printed and no VME data write to the standard output.
Trigger Controls
ŕ
BlkRd VME FIFO will ask user to give number of data words to be read from VME FIFO, and grab them and write to the standard output.
Trigger Controls
ŕ
Mty VME FIFO (print) dumps the contents of the CSM0 VME FIFO to the standard output without checking the EVID/WC register. There will probably be an extra zero between events. The word is there to counteract a problem with the VME chip used by the CSM0 where the chip grabs an extra word. This zero word is discarded in data acquisition runs.
Trigger Controls
ŕ
Mty VME FIFO (no print) empties the VME FIFO without printing. Only total number of dumped data words will be printed at end.
Trigger Controls ŕ Read VME FIFO will ask user to give number of data words to be read from VME FIFO, and read VME FIFO word by word, i.e., block transfer is not used. The data words are written to standard output.
Trigger Controls
ŕ
Read VME FIFO will ask user to give number of data words to be read from VME FIFO, and read VME FIFO word by word, i.e., block transfer is not used. The data words are written to standard output.
If software trigger is used, a combined command button
for steps 4 and 5 is provided to read event where issuing software triggers is not required. Warning: Repeat counter should be no more than trigger limits, otherwise it may result in data error. If external trigger is in use, the same button with name
can be used to read event directly. Here the event is read by using same way as Trigger Controls
ŕ
Read FIFO All
ŕ
Print.
The most useful registers for general diagnostics of data acquisition are TDC stop bits in the FIFO Threshold, the Stop & Full Flags, the received headers and received trailers registers which are selected by the Readback Register box and read by clicking on
button. The received headers and trailers registers can also be read with Trigger Controls -> Received Hdrs and Trigger Controls -> Received Trls. These are 3 byte registers where each byte is on if the header or trailer for that CSM0 input channel has been received. When a full set of headers and trailers have been received these registers reset back to all zeroes until the next trigger.
Save all CSM0 registers
There is a useful tool for understanding the any DAQ hang problem, where all the CSM0 registers are read and saved into a file which is done by using Execute
ŕ
Read & Save Registers in the main CSM MiniDAQ window. The saved register log file has a file name is <***_register.log>, where *** is the data file name without “.dat” in File Name text box. It is useful for the CSM0 board and data acquisition diagnostics. Also this could be used for CSM0 board diagnostics.
Using Multiple CSMs
It is worth to point out the command button
which will let user to turn on/off whether to reset other CSMs during data taking if there are at least 2 CSM0 boards in the VME crate. This is used to demonstrate that the multiple CSM0 boards in same VME crate are functional normally.
5.4
Run DAQ with Software Trigger
It is allowed to take data with software trigger where the number of issued software triggers before reading data is known, therefore it provides a controlled way for user to debug data acquisition system and to study the noise problem in the readout since the software trigger has no time relationship with respect to the data signals (= random trigger). To enable the software trigger for a run, use Global Controls
ŕ
Use Software Trigger for DAQ in CSM0 Diagnostic window. Due to the fact the trigger FIFO limit is not used to constrain the software trigger and its length is 16, the maximum allowed number of software triggers in a row without reading out the data is 16 to avoid CSM0 EVID (counted by number of trigger) mismatching with data EVID(from CSM0 input cards).
If the software trigger is enabled for the data taking, user will be asked to confirm it for every run in case the run is not started automatically since the software trigger should not be used in most cases for data taking. Also that is the reason why there is no easy access to enable the usage of software trigger from the run control window (main CSM window), instead it is controlled in the CSM0 diagnostic window. After enable the software trigger for the DAQ and quit from the CSM0 diagnostic window, the DAQ could be started from the main CSM window as normal data taking.
6 Useful Information
6.1 Varies Panels and Controls
CSM Register Setup Panel
The CSM register setup window (Figure 22) can be brought up by clicking on
button in the main CSM MiniDAQ window, where CSM0 register contents can be modified and will be used for data taking. No all the CSM0 register settings will be valid for data acquisition (for instance ID codes should never be changed), therefore caution is absolutely necessary in changing CSM0 register settings. If the PROM version is 0x21020 or higher, the event prescale factor could be chose for DAQ up to 100KHz level.
Figure 22. CSM Register Setup Window
CSM0 Base:
The CSM0 base (switch settings) could be modified by the command box
in the main CSM MiniDAQ window and by the command box CSM0 Base Address of CSM0 diagnostic window, which allow user to use different CSM0 or change CSM0 switch settings for base address.
·
Cold Start:
Execute
ŕ
CSM Board Cold Start performs a power up sequence for the CSM0 board and issues a global reset where the TDC enable mask will be kept. If the data acquisition is hang, this command could be used to reset the DAQ system and ensure the continuation of the data acqusition.
·
Set Run Number for Next Run:
It allows to set run number for next run, otherwise the run number is automatically increased by one for new run when Disk option is selected.
·
Save error summary:
Execute
ŕ
Save Data Error Report save error summary report into a file.
·
Save error summary:
Execute
ŕ
Data Error Report brings up the data error report window.
6.2 DAQ Parameter File
Basic DAQ parameters are written into file <DAQpara.txt> for future usage. The saved DAQ parameters are listed below:
Default Profile Saved : 0
CSM0 Base : 0x02000000
Run Number : 10000
# Used Mezz. Cards : 0
EVID Preset Value : 0
BCID Preset Value : 4018
BCID Rollover : 4095
Block Transfer in DAQ : 0
Direct VMEMap Warning: 0
Only Save Logfiles : 0
// Save CSM0 Clock (40MHz) counters 0 = Do Not Save
// 1 = Save to ASCI file
// 2 = Save to Binary file
Save Clock25 Counters : 0
// Collect data till VME FIFO full if enabled.
waitTill VMEFIFO Full : 0
// DAQ infor precision (# decimal points) is used for average event size and data flow
// rate. Allowed value is from 0 to 4, only the number is allowd to be changed.
DAQ Infor Precision : 2
Normally it is not necessary for user to change any DAQ parameter. Few options may be useful. Only log files will be put into disk if one turns on
“Only Save Logfiles”
.
For PROM with version number 0x21020 or higher, the absolute trigger time could be obtained by reading out clock 25 counter. Also
it is allowed to change the decimal precision of average event size and data flow rate for DAQ infor window through the line of
“
DAQ Infor Precision : 2”
, where allowed value is from 0 to 4 for the decimal precision places.
6.3 Automatic Run Control File
MiniDAQ3.0.0 provides a flexible way to make automatic runs at different DAQ settings. The automatic run control file has a file extension of “.ctrl”, and the format of the control file is user friendly and easy to use. A simple automatic run control file <example.ctrl> is included in the distribution, it is recommended to refer to <example.ctrl> to make an automatic run control file.
Comments:
Any line starts with //, /* or *. Please note,
commends must be preceded by //, /* or *, otherwise undesired effect or DAQ problem may occur.
Commands:
A command contains two parts “Key Words” and “Command Parameter”, where the “Command Parameter” is separated from “Key words” by “:” or blank space. A command line looks as following:
Key Words : Command Parameter
Following automatic run control commands are available:
·
Run Number :
Run number (unsigned int)
·
Number of Event :
Number required events for the run (unsigned int)
·
DAQ Time (s) :
Required DAQ time in seconds (unsigned int)
·
TDC Enable Mask (HEX) :
TDC selection mask (Hexdecimal)
·
Trigger Limit :
CSM0 trigger limit 0 to 14
·
Event Prescaled Factor :
Event prescaled factor 1, 101, 1009 and 10007 only valid for PROM with version number 0x21020 or higher
·
Storage Selection :
Data output selection 0 and 1
0 = No Storage
1 = Auto Generated Filename
·
Data Analysis :
Data monitor enable/disable (1/0 == on/off)
·
DAQ Infor :
DAQ INFOR enable/disable (1/0 == on/off)
·
Profile :
Profile name
·
Matching Window :
AMT matching window (int)
·
AMT Channel Enable (HEX):
AMT channel enable/disable (Hexdecimal)
·
ASD Channel Enable (HEX) :
ASD channel enable/disable (Hexdecimal)
·
ASD Threshold (mV) :
ASD main threshold in mV (int)
·
ASD1 Threshold (mV) :
ASD1 main threshold in mV (int)
·
ASD2 Threshold (mV) :
ASD2 main threshold in mV (int)
·
ASD3 Threshold (mV) :
ASD3 main threshold in mV (in