CSM MiniDAQ Quickstart Guide
University of Michigan
August 29, 2001
J. Gregory
University of Michigan Physics
2
Contents
Section
Page
1.
Introduction to the CSM MiniDAQ
.
.
.
.
3
2.
Starting the CSM DAQ
.
.
.
.
.
.
4
3.
JTAG Programming
.
.
.
.
.
.
5
3.1
Connecting the hardware
.
.
.
.
.
5
3.2
Enabling the JTAG serial connection .
.
.
.
5
3.3
Loading a saved profile
.
.
.
.
.
6
3.4
Applying a common setup
.
.
.
.
.
6
3.5
Applying an individualized setup
.
.
.
.
7
3.6
JTAG and *NIX
.
.
.
.
.
.
7
4.
Acquisition Runs
.
.
.
.
.
.
.
8
4.1
Enabling AMTs
.
.
.
.
.
.
8
4.2 Selecting Storage
.
.
.
.
.
.
9
4.3
Beginning a run
.
.
.
.
.
.
9
4.4
Accumulating data
.
.
.
.
.
.
9
4.5
Ending a run
.
.
.
.
.
.
.
9
5.
Diagnostic Tools
.
.
.
.
.
.
.
10
5.1
Using the CSM0 Diagnostic panel
.
.
.
.
10
5.2 Using the JTAG Diagnostics pane
.
.
.
.
12
Appendixes
A. AMT1 Control Bits
.
.
.
.
.
.
13
A.1
Main Setup Panel
.
.
.
.
.
.
13
B. Data Formats
.
.
.
.
.
.
.
15
B.1
CSM Words
.
.
.
.
.
.
.
15
B.2
TDC Words
.
.
.
.
.
.
.
15
B.3
Data buffer
.
.
.
.
.
.
.
16
C. Build Options
.
.
.
.
.
.
.
17
D. References
.
.
.
.
.
.
.
18
University of Michigan Physics
3
1
Introduction to the CSM MiniDAQ
CSM MiniDAQ is software developed at the University of Michigan using National
Instruments LabWindows/CVI (part of Measurement Studio) and is a specialized version
of the ATLAS MiniDAQ software for use with the CSM0 Module also developed at the
University of Michigan. The purpose of the ATLAS MiniDAQ is to provide access to
the CSM and AMT hardware in an easy to use windows interface. The ATLAS
MiniDAQ has three major functions: JTAG programming, data acquisition, and hardware
diagnostics.
More detailed information on the CSM and ATLAS MiniDAQ [1], the AMT1 [2] and
the CSM project [3] can be found in their respective manuals. This guide is designed to
be a guide to users new to the CSM MiniDAQ and combine the most commonly needed
aspects of several sources into one concise guide.
The newest distribution version of the CSM MiniDAQ is version 1.3.3, which fixes many
of the bugs in earlier versions of the MiniDAQ and includes some minor upgrades. The
screen shots in this guide are from versions v1.3.2 and v1.3.3. These versions are
identical in all respects except that v1.3.3 has the startup sequence discussed here.
Version 1.3.2 was never widely distributed. The new sequence for starting a data
acquisition run is the main change in the new version, but otherwise all the information
applies to earlier versions except
JTAG > Setup Send
does not exist in versions earlier
than v1.3.2 and it is not possible to set up individual AMT cards in the earlier versions.
University of Michigan Physics
4
2
Starting the CSM MiniDAQ
Figure 1. The CSM MiniDAQ main window
This guide assumes you are using a National Instruments VME interface for the CSM
card. If you are not using a National Instruments compatible controller card, the standard
CSM MiniDAQ distribution will not work and the code will need to be modified to take
into account the different drivers. 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 default address for a card is 0x2000000.
The CSM MiniDAQ program is started with the file csm0.exe, which brings up the main
CSM MiniDAQ window. The first step in data acquisition or diagnostics using an AMT
card is to use JTAG to program the AMT cards. All of the necessary commands for
JTAG programming are in the
J
TAG
pulldown menu, including the JTAG diagnostic
panel. Saved programming profiles are accessed from the
File
menu. Once JTAG
programming is finished, standard data acquisition commands are all located on the main
window. Diagnostic tools including test data acquisition are located on the Diagnostics
Panel, which is accessed from the
D
iagnostics
menu.
University of Michigan Physics
5
3
JTAG Programming
JTAG Programming consists of five steps, two of which are optional:
1.
Connect the hardware or check of the hardware setup.
2.
Enable the JTAG serial connection.
3.
Load a saved profile (optional)
4.
Apply a common setup to the AMT cards
5.
Apply individualized settings to any AMT cards (optional)
Once the AMT cards have been programmed, the setup used can be saved for later use.
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 AMT1 cards. The 4channel
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 18channel adapter card automatically includes each device plugged into it in the
JTAG chain. The leftmost device on the 18channel adapter card is the first device in the
chain. The rightmost device on the 4channel 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 18adapter 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
Enabling the JTAG serial connection
To enable the JTAG serial connection,
click on the
JTAG
menu and select
“Enable JTAG Serial.” The
JTAG Serial
Enabled
LED should turn green. It is
important to disable JTAG serial before
taking data, and to disable JTAG serial,
select
JTAG > Disable JTAG Serial
.
Only when JTAG serial is enabled will the
JTAG programming and JTAG diagnostic
commands be available.
University of Michigan Physics
6
3.3
Loading a saved profile
To load a saved profile, select
File > Load Profile
. This
will bring up a file open dialog and display files of type .prf.
Included with the CSM MiniDAQ is a file called default.prf
that contains standard setup options, but these will need to be
tweaked for the particular hardware setup to be programmed.
A saved profile contains both the general JTAG setup and the
individual JTAG setups, however loading a profile does not
apply any settings to the AMT and Setup All or Setup Send must still be run. Setup Send
is only available in versions of the CSM MiniDAQ later than 1.3.2. Setup Send takes the
current JTAG profile and loads it to the AMT devices without any intermediate steps and
applies both a common setup to all cards and then programs any individual setups that
have been created. Setup send is accessed via
JTAG > Setup Send
. If you have a setup
you would like to reuse, save the setup with
File > Save Profile
.
3.4
Applying a common setup
Before individual setups can be accessed, a common
setup must be applied to all attached AMT cards. To
apply a common setup to the AMT cards select
JTAG >
Setup All
.
The setup screen for the AMT1 contains a plethora of
switches, number boxes and a few buttons tossed in for spice. If a saved profile has been
loaded, check that the
Total no. of TDCs
is correct and click
.
Figure 2. JTAG Setup for Mezzanine Cards
University of Michigan Physics
7
If not using a saved profile, or if the saved profile is not correct, the setup values will
need to be modified. The
button accesses the AMT1 JTAG Channel Select
panel and the
button accesses the AMT1 JTAG Error Setup panel. The JTAG
programming is not applied until the
button on the
JTAG Setup for
Mezzanine Cards
window is selected.
closes the window and reverts to any
previous values. All of the AMT1 options are explained in Appendix A, which is a
summary of the command register section of the AMT1 manual. For most options, the
default values will be sufficient. The values that will need the most tweaking are Trigger
Offset, DAC Voltage Output, and the Mask, Search and Match Windows.
3.5
Applying an individualized setup
Once a common setup has been
applied to the attached AMT cards,
any given AMT card can be
individualized. In most cases this is
not necessary. To setup an individual
AMT card selected
JTAG > Setup
Individual > Mezzanine
N
, where
N
is
the number of the mezzanine card in
the JTAG chain. This will only agree
with the TDC number on the CSM0 if
the JTAG chain order agrees with this CSM0 numbering. 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. Individualized settings saved into a profile are not applied until setup individual
has been run on that card or
Setup Send
has been run.
3.6
JTAG and *NIX
To facilitate JTAG programming in a *NIX environment, CSM MiniDAQ has the ability
to produce a text output of the JTAG programming string. To get a text output of the
JTAG setup, toggle the
Save Bit String
button
,
located in the lower right hand corner, to
say “SAVE”. No utility is provided for reading this file in *NIX and sending it out to
JTAG devices.
University of Michigan Physics
8
4
Acquisition Runs
After using the JTAG commands to program all attached AMT cards, the next step in
standard use is to setup and begin a data acquisition run. Data acquisition is handled
from the main CSM MiniDAQ panel. There are four steps to collecting data:
1.
Enable the AMT cards to be monitored during the run.
2.
Select Storage
3.
Begin the run.
4.
Accumulate data.
5.
End the run.
4.1
Enabling AMTs
To enable AMTs, click
on the main CSM MiniDAQ panel. AMTs are
enabled with the
TDC Enables
panel. If an AMT is not enabled the CSM will not expect
data from that card and will ignore any data sent by that card. To turn channels on or off
for all AMT cards, click on
Channels
on the
JTAG Setup for Mezzanine Cards
panel,
accessed from
JTAG > Setup All
. To turn channels on or off for an individual AMT
card, click on Channels in the individual setup panel for that card and select the channels.
The TDC Enables panel is for turning on an entire AMT, and not individual channels.
Figure 3. TDC Channel Enables panel
For normal operations, it is sufficient to select the TDCs to be enabled and then hit done.
Enabling a TDC that is not connected to the CSM will hang the data acquisition
processes while the CSM0 waits for data from a card that
is not there. The enabled AMTs are indicated by the TDC
Enable mask.
University of Michigan Physics
9
4.2
Selecting Storage
Figure 4. Storage section of main panel, lower left section
Before starting a new run, it is important to select how data is to be
stored. There are two main choices, either store data to a disk or to
discard acquired data. Select between
Disk
and
None
using the
Storage
pull down menu.
If
None
is selected, data will be discarded, however the
Analyze
command can be used
to check the data for missing words or errors, and is a useful diagnostic tool. To use
Analyze, click
Analyze
anytime when there is no active data acquisition run. If Analyze
is enabled, the indicator will turn from red to green.
If
Disk
is selected, data will be stored in the file indicated by
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.
Analyze
will
work when
Disk
is selected, but the limit to the trigger rate will be lower.
4.3
Beginning a run
To begin a run, hit the button
. CSM MiniDAQ will ask for the run
number. Hitting
Enter
will default to incrementing the run number by one. After
clicking
OK
or hitting
Enter
the run proceeds.
Data will either be stored to the file in
File Name
or will be discarded depending on the
value of Storage. See 4.2 Selecting Storage Option.
4.4
Accumulating data
Once a run is begun (see the previous section), data acquisition is automatic. The
Evt No
status box will automatically update as triggers are read. To allow for faster data
acquisition, data from multiple events are written into a single buffer that is stored to disk
when it is full. The number of these buffers stored to disk is indicated by
Buffers
.
During the run,
and
on the CSM MiniDAQ main panel can
be used to resume and suspend data acquisition.
4.5
Ending a run
Once enough triggers have been read for the run, click
on the CSM MiniDAQ
main panel to begin the run termination process. The CSM MiniDAQ will ignore any
new triggers, read the rest of the buffered events, and flush the last buffer to disk.
University of Michigan Physics
10
5
Diagnostic Tools
CSM MiniDAQ provides tools for diagnosing JTAG programming errors, data
acquisition, and the CSM0 hardware. JTAG programming has a diagnostic panel that
can be used when JTAG serial is enabled by clicking
JTAG > Diagnostics
. CSM0
hardware and data acquisition diagnostic tools can be accessed with
Diagnostics > Run
.
5.1
Using the CSM0 Diagnostic panel
Figure 4. CSM0 Diagnostic Panel
Taking data with the diagnostic panel requires that the
AMT cards have been programmed using JTAG. Emulator
cards do not require JTAG programming, however the
software reset is not always sufficient for these cards and
the hardware reset button on the emulator card should be
used before trying to read its output.
Once the AMT or emulator cards are ready, follow these steps:
1.
Click
. This command resets the CSM0 and the AMT
cards.
2.
Select
CSM0 Controls > Enable TDCs
and select TDCs that are attached to the
CSM0, this procedure is the same as in
4.1 Enabling AMTs
.
3.
Click
Set/Clear DAQ
Active
.
4.
To read external triggers,
click
Set/Clear Ext Trigger Enable
, to send a software trigger click
Trigger
Controls > Software Trigger
.
University of Michigan Physics
11
Several methods are available for reading the VME FIFO and checking on the data
received by the CSM0.
Expand FIFO Print
will include decipher the hex words read from
the CSM0 to a more readable form.
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,
is waiting for a missing header or trailer, or
there is an EVID mismatch.
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 0x0 word 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.
Readback
displays the contents of the register indicated by the
Readback Register
. The most useful registers for general
diagnostics are the received headers and received trailers
registers which 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 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.
CSM0 Controls > Disable EVID match
and
CSM0
Controls > Disable BCID match
will allow the CSM0 to
read events where the EVID and BCID of the TDC data
does not match the CSM0 internal EVID and BCID.
University of Michigan Physics
12
5.2
Using the JTAG Diagnostics panel
The JTAG Diagnostics panel is useful for checking if the
AMT boards are configured correctly. To bring up the
JTAG Diagnostics panel, Enable JTAG Serial must be
on, then click
JTAG > Diagnostics
.
Check Status
downloads the status registers of the AMT card indicated by
TDC ID
.
Check JTAG
downloads the control registers of the AMT card indicated by
TDC ID
and
displays the contents in a panel.
Global Reset
performs a reset using the control registers of the AMT. Using
Global
Reset
can change the JTAG programming of the AMT cards and its use is not suggested.
Figure 4. JTAG Diagnostics panel
University of Michigan Physics
13
Appendix A.