COT Control Voltages - "setcv"


Introduction/setup:

"setcv" is a C-based routine that programs the VME DAC modules, located in the COT TDC crates, which set the control voltages for the ASDQ. The "setcv" program is located on the "cdfdaq" account of the B0 machines in the directory:

   /cdf/people1/cdfdaq/setcv/
The command alias "setcv" on the "cdfdaq" account is:
   setup fision; cd ~cdfdaq/setcv; ./setcv_${MACH_OS}
and performs the FISION setup, changes to the "setcv" directory, and starts the appropriate executible so that you may run from the IRIX machine b0dau30 or any of the Linux machines b0dap## transparently.

Therefore, all you need to do is:

  1. ssh cdfdaq@b0dau30    or    ssh cdfdaq@b0dap##
  2. setcv


Running "setcv":

Starting "setcv" with no command-line parameters runs an interactive mode, where the available commands are:

   Command list: 

    c                  -->  goto command line 
    e [text]           -->  echo text 
    f [file]           -->  input script file 
    h                  -->  help list 
    p                  -->  command line prompt 
    q                  -->  quit program 

    mc                 -->  close server 
    mo [serv] [addr]   -->  open server at address (hex) 
    mr [addr]          -->  read address (hex) 
    mv [valu]          -->  verbose value (0-3) 
    mw [addr] [data]   -->  write data (hex) 

    dc                 -->  close DAC 
    dl [func]          -->  DAC LED (0=off,1=on,>1=blink) 
    do [serv] [addr]   -->  open DAC, go online 
    dr [chan]          -->  read channel (1-32,0=all) 
    dt [chan]          -->  test channel (1-32,0=all) 
    dv [valu]          -->  verbose value (0-1) 
    dw [volt] [chan]   -->  write voltage (integer,mV) 

    atn [volt]         -->  attenuation (0=off,3000=on) 
    dth [volt]         -->  disc threshold 
    tre [volt]         -->  trigger ref (even) 
    tro [volt]         -->  trigger ref (odd) 
    qen [volt]         -->  charge enable (0=on,3000=off) 
    qdr [volt]         -->  drain current 

    ea, eb, ec, ed     -->  open East Quad A,B,C,D 
    wa, wb, wc, wd     -->  open West Quad A,B,C,D 
    def                -->  apply default settings 
    tst [nv] [nt] [fn] -->  run module test procedure 

    co [SL] [QD]              -->  open COT DAC 
    cr [CV] [SL] [QD]         -->  read COT DAC values 
    ct [CV] [SL] [QD]         -->  test COT DAC values 
    cw [CV] [volt] [SL] [QD]  -->  write COT DAC values 

   Command(): 
Hitting ENTER repeats the previous command. Any of the "setcv" commands can be entered on the command line if they are preceded by a dash "-". For example, the following command:
   b0dau30> setcv -ea -dth 200 -qdr 1500
is equivalent to entering "setcv" and executing the ea, dth, and qdr commands:
   b0dau30> setcv

    Command(): ea
    Command(): dth 200
    Command(): qdr 1500
    Command(): q

   b0dau30>
Alternatively, "setcv" can read a script file of commands (with no preceding dashes) using the f command, which is useful for performing repetitive commands. Script files can be nested (up to 8 files deep). The "#" sign denotes comments within a script file. For example:
   b0dau30> setcv -f pulser
executes the commands from file pulser, which loops over the eight DAC modules (ea,eb,ec,ed,wa,wb,wc,wd) and writes control voltage settings from the script file pulser_settings:
   # setcv script file: "pulser_settings"
   #
   #    This script file programs the 6 control voltages of a given DAC.
   #
   # --------------------------------------------------------------------------
   #
   atn 0
   dth 250
   tre 2500
   tro 2500
   qen 0
   qdr 1000


Trouble-shooting:

If a crate is temporarily busy (rebooting, for example), you may get the message:

   FISION: VME BUS ERROR RECEIVED
but the setcv program will keep chugging along anyway. If the program appears to hang for a long time, then just Control-C out of the program and try again later. This happens, for instance, if the crate is powered off, or in some deeper stage of resetting.


Background:

The COT DAC voltages control the various functions of the ASDQ front-end boards (discriminator threshold, attenuation, etc.). Specifically, these voltages are (all values are in mV):

   ATN --> factor-of-two attenuation (0="off", 3500="on", default 0)

   DTH --> discriminator threshold (0-3000 range, default 225)

   TRE --> calibration trigger reference, even wires (0-5000, default 0)

   TRO --> calibration trigger reference, odd wires

   QEN --> dE/dx enable (0="enabled", 3500="disabled", default 0)

   QDR --> output width control (-3000 to 3000, default 0)
While there are six different control voltages, they are set independently for each quadrant of each superlayer, for a total of 192 values. These are set by eight 32-channel DAC modules, one for each quadrant per East and West sides. East quadrants control superlayers (1,4,5,8) and West controls (2,3,6,7), so only 24 channels of each DAC are used. There is only one DAC module per TDC rack, so a single DAC controls ASDQ boards associated with two (lower) or three (upper) TDC crates. The mapping is (where the "*" denotes the crate with a DAC, and the view faces the endplate):

       -----------      -----------         -----------      -----------
      | b0cot02 * |    | b0cot03 * |       | b0cot13 * |    | b0cot12 * |
      | b0cot01   |    | b0cot04   |       | b0cot14   |    | b0cot11   |
      | b0cot00   |    | b0cot05   |       | b0cot15   |    | b0cot10   |
   N   -----------      -----------    S    -----------      -----------   N
   O                                   O                                   O 
   R               WEST                U                EAST               R 
   T                                   T                                   T 
   H   -----------      -----------    H    -----------      -----------   H
      | b0cot09 * |    | b0cot06 * |       | b0cot16   |    | b0cot19 * |
      | b0cot08   |    | b0cot07   |       | b0cot17 * |    | b0cot18   |
       -----------      -----------         -----------      -----------


Dave Ambrose, University of Pennsylvania, ambrose@fnal.gov