CSM0 Software Organization

R. Ball

July 24, 2000

 

23-July-2000 2

General Information

n Code Written in ANSI C

n Software modules are layered, with hardware-

specific access contained in a single module

n Basic CSM-0 driver easily ported to other

platforms

 

23-July-2000 3

General MiniDAQ Structure

General layout of software modules.

GUI or Program

Utility Packages

Driver Packages

Hardware Access

 

23-July-2000 4

Software Structure

n Highest level program can call driver routines

directly ( eg , CSM Driver register access)

n Can use utility packages which, in turn, call

drivers or other utility packages ( eg , JTAG

programming AMT0 mezzanine cards)

n Driver and utility packages can be used in other

environments, eg , UNIX or OS9

n The ATLAS MiniDAQ is a high level GUI

specifically designed to control the CSM-0

utilizing both methods.

 

23-July-2000 5

ATLAS MiniDAQ Main GUI

 

23-July-2000 6

Simplest Use of MiniDAQ

n Enable active TDCs

n Start Data Run

n Drink Coffee

n End Data Run

n Take data file home and analyze it

 

23-July-2000 7

More Complex Use of MiniDAQ

n Add some intelligence by scanning or anlyzing

incoming data as it is acquired, eg , “Analyze”

button checks data buffer integrity in case of a

single active TDC.

n Program JTAG. Read in a JTAG profile using

“File->Load Profile”. Enable JTAG serial

operations, then modify and apply the settings to

all active TDCs (JTAG->Setup All).

 

23-July-2000 8

JTAG Programming Panel

 

23-July-2000 9

More Complex MiniDAQ (2)

n Individual TDCs can be programmed differently

than others (JTAG->Setup Individual)

n Setup All sequence can be used to initiate a DLL

lock by first selecting that JTAG menu item.

n Changing JTAG settings may necessitate changing

default register settings.

Issue a “Diagnostics-> ColdStart ” if any values are

modified

n Full Register access for debugging via

“Diagnostics->Run”.

 

23-July-2000 10

Changing Default Registers

 

23-July-2000 11

The Diagnostics Panel

Most registers available for direct read/write

including repeated operations.

 

23-July-2000 12

Diagnostic Triggering

n Random Triggering and data viewing is possible

w “AMT Read Prep” button

w CSM0 controls -> Enable TDCs

w Set DAQ Active

w Trigger Controls -> Software Trigger

w Trigger Controls -> Read FIFO All -> Print

n Many menu items unavailable except when using

diagnostic PROM

 

23-July-2000 13

UNIX or OS9 Control of CSM-0

n Reset CSM-0 (all register content reset to zero)

SetCSM _Base(0x2000000);

MasterReset ();

n Program JTAG

SetJTAGRate ( GetCSMState (INI_JTAG_SET);

EnableSerial ();

No_GUI();

n Modify default register settings

SetCSMReg (Register, value); where Register is one of

INI_[JTAG|PIPE|AMT_PIPE|ROLLOVER|PRE_EVID

|PRE_BCID|IDC|FIFOT]_SET

 

23-July-2000 14

(More) UNIX/OS9 Control

n Preset CSM-0 and AMT-0

ColdStartCSM ();

DisableBCID ();

GlobalReset ();

EventReset ();

BunchReset ();

n Enable active TDC channels

WriteCSM4(mask, TDC_CONTROL, base);

B “Mask” bits 0-17 have direct correspondence to TDC inputs

 

23-July-2000 15

(More) UNIX/OS9 Control

n Enable DAQ

SetDaqActive ();

SetTriggerEnable ();

n Acquire data

CSM0_Read_ Reg (&read, BOARD_STATUS);

if (read & EVENT) {

CSM0_Read_ Reg (& Evid _WC, EVID_WORD_COUNT);

word_count = Evid _WC & 0xFFF;

FIFO_ Mty _All ( word_count, data_buffer);

}

 

23-July-2000 16

(More) UNIX/OS9 Control

n Disable DAQ

ClearTriggerEnable ();

-> Pause here to allow triggers to trickle in <-

ClearDaqActive ();

Back to top