JLab F250ADC
JLab has built their own Flash ADC (called the F250)
It has a mini trigger connector which requires another VME board to convert from the standard lemo input to this mini input.
Addressing
JLab's F250 flash ADC will be used to measure the NaI output
ADdress is
Address | ||
Pin | Switch | bit |
A12 | on/closed | 0 |
A13 | on | 0 |
A14 | on | 0 |
A15 | on | 0 |
A16 | on | 0 |
A17 | off/open | 1 |
A18 | off | 1 |
A19 | off | 1 |
A20 | on | 0 |
A21 | off | 1 |
A22 | off | 1 |
A23 | off | 1 |
Module address = 0xee0000 = 111011100000000000000000 d
If I want 0xaa0000 = 101010100000000000000000 d
If I want 0xbb = 10111011
Address | ||
Pin | Switch | bit |
A12 | on/closed | 0 |
A13 | on | 0 |
A14 | on | 0 |
A15 | on | 0 |
A16 | off | 1 |
A17 | off/open | 1 |
A18 | on | 0 |
A19 | off | 1 |
A20 | off | 1 |
A21 | off | 1 |
A22 | on | 0 |
A23 | off | 1 |
check status
-> faStatus(0) STATUS for FADC in slot 4 at base address 0x90bb0000 -------------------------------------------------- Board Firmware Rev/ID = 0x0114 : ADC Processing Rev = 0x0909 Alternate VME Addressing: Multiblock Disabled A32 Enabled at VME base 0x08000000 or CPU addr 0x80000000 Signal Sources: Ref Clock : Internal Trig Src : Front Panel (Async) Sync Reset: VME (Software) Configuration: Internal Clock ON Bus Error DISABLED MultiBlock transfer DISABLED Software Sync Reset ENABLED ADC Processing Configuration: (0x0040 0x0040) Channel Disable Mask = 0x0000 Resolution = 10 bits Mode = 1 (Disabled) Lookback (PL) = 0 ns Time Window (PTW) = 64 ns Time Before Peak = 0 ns Time After Peak = 0 ns Max Peak Count = 4 CSR Register = 0x006318e0 Control 1 Register = 0x00030e1f Control 2 Register = 0x00000000 - Disabled Internal Triggers (Live) = 0 Trigger Scaler = 0 Events in FIFO = 0 (Block level = 1) value = 44 = 0x2c = ','
Software Trigger
Initialize FADC for software trigger mode
Initialize the FADC so it will accept software triggers.
faInit(0xbb0000,0,0,0)
-> faInit(0xbb0000,0,0,0) Initialized FADC 0 Slot # 4 at address 0x90bb0000 faInit: Enabling FADC Internal Clock, and Software Triggers (Soft Sync Reset) value = 0 = 0x0
- Notice FADC ID is 0 in Slot 4 (the slots are number according to their location from the left most slot in the crate which starts counting at 1)
define processing mode
int faSetProcMode(int id, int pmode, unsigned int PL, unsigned int PTW, unsigned int NSB, unsigned int NSA, unsigned int NP, int bank) id = slot number An example of this should be in one of the Readout lists, however, right now there are 3 viable processing modes (pmode =1,2 or 3) pmode = 1 RAW Window mode: all samples within PTW are saved pmode = 2 RAW Pulse mode: NSA+NSB+1 samples around a threshold crossing are saved. pmode = 3 Integral pulse mode: NSA+NSB+1 samples are summed and the sum along with the timestmp for the threshold crossing are saved. PL = latency = PL=20 => 200 nsec; time delay to record measurements after trigger is received and time window begins PTW= 20 => 80 nsecPulse Time width = time interval window for measurements Assuming the Clock is 250 MHz => clock pulse widths are 4 nsec
faSetProcMode(4,1,40,38,3,6,1,0)
check using the status command
-> faStatus(0) STATUS for FADC in slot 4 at base address 0x90bb0000 -------------------------------------------------- Board Firmware Rev/ID = 0x0114 : ADC Processing Rev = 0x0909 Alternate VME Addressing: Multiblock Disabled A32 Enabled at VME base 0x08000000 or CPU addr 0x80000000 Signal Sources: Ref Clock : Internal Trig Src : VME (Software) Sync Reset: VME (Software) Configuration: Internal Clock ON Bus Error DISABLED MultiBlock transfer DISABLED Software Triggers ENABLED Software Sync Reset ENABLED ADC Processing Configuration: (0x0040 0x0040) Channel Disable Mask = 0x0000 Resolution = 10 bits Mode = 1 (Disabled) Lookback (PL) = 0 ns Time Window (PTW) = 64 ns Time Before Peak = 0 ns Time After Peak = 0 ns Max Peak Count = 4 CSR Register = 0x006318e0 Control 1 Register = 0x00030eef Control 2 Register = 0x00000000 - Disabled Internal Triggers (Live) = 0 Trigger Scaler = 0 Events in FIFO = 0 (Block level = 1) value = 44 = 0x2c = ',' ->
Trig Src : VME (Software)
Set the internal trigger pulse width
set the internal trigger pulse width to 2 clock ticks (8 ns)
/* * Set Internal trigger pulse width and deadtime between triggers * Range for each : 4ns <-> 1020ns * * Units are in clock ticks (4ns/tick) */ faItrigControl(int id, unsigned short itrig_width, unsigned short itrig_dt)
-> faItrigControl(0, 2, 0 ) value = 131082 = 0x2000a
Enable all channels
-> faEnable(0,0,0)
Generate a software trigger
-> faTrig(0) value = -1866792960 = 0x90bb0000 = tclOpenFiles + 0x82ef31a0
check if there is an event in the FIFO
-> faStatus(0) STATUS for FADC in slot 4 at base address 0x90bb0000 -------------------------------------------------- Board Firmware Rev/ID = 0x0114 : ADC Processing Rev = 0x0909 Alternate VME Addressing: Multiblock Disabled A32 Enabled at VME base 0x08000000 or CPU addr 0x80000000 Signal Sources: Ref Clock : Internal Trig Src : VME (Software) Sync Reset: VME (Software) Configuration: Internal Clock ON Bus Error DISABLED MultiBlock transfer DISABLED Software Triggers ENABLED Software Sync Reset ENABLED ADC Processing Configuration: (0x0040 0x0040) Channel Disable Mask = 0x0000 Resolution = 10 bits Mode = 1 (Disabled) Lookback (PL) = 0 ns Time Window (PTW) = 64 ns Time Before Peak = 0 ns Time After Peak = 0 ns Max Peak Count = 4 CSR Register = 0x006318e3 Control 1 Register = 0x00030eef Control 2 Register = 0x00000007 - Enabled for triggers Internal Triggers (Live) = 0 Trigger Scaler = 1 Events in FIFO = 1 (Block level = 1) - Data Available RAM Level (Bytes) = 0 value = 26 = 0x1a ->
Now I see an event in the FIFO
Print FIFO status
-> faPrintFifoStatus(0) Fifo Buffers Status (DataFlow Status = 0x0000013d Input Buffer : 0x90009000 FPGA1: wc=0 Empty=1 Full=0 Ready=1 FPGA2: wc=0 Empty=1 Full=0 Ready=1 Build Buffer : 0x10001000 FPGA1: wc=0 Empty=1 Full=0 FPGA2: wc=0 Empty=1 Full=0 Output Buffer: 0x20002000 FPGA1: wc=0 Empty=1 Full=0 FPGA2: wc=0 Empty=1 Full=0 value = 34 = 0x22 = '"'
Count events ready to be readout
you can count how many events or blocks are ready to be read out with the command
-> faDready(0,0) value = 1 = 0x1
try to read a block
-> faPrintBlock(0,0) 81000801 - BLOCK HEADER - slot = 4 n_evts = 1 n_blk = 1 90000008 - EVENT HEADER 1 - evt_num = 8 8 - EVENT HEADER 2 - evt_num = 8 98EEF118 - TRIGGER TIME 1 - time = EEF118 D1E17A - TRIGGER TIME 2 - time = D1E17A EEF118 - TRIGGER TIME 3 - time = EEF118 D1E17A - TRIGGER TIME 4 - time = D1E17A A0000026 - WINDOW RAW DATA - chan = 0 nsamples = 38 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 11001100 - RAW SAMPLES - valid = 1 adc = 4352 valid = 1 adc = 4352 A1000026 - WINDOW RAW DATA - chan = 2 nsamples = 38 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 80004 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40000 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 0 0 - RAW SAMPLES - valid = 1 adc = 0 valid = 1 adc = 0 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40000 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 0 4 - RAW SAMPLES - valid = 1 adc = 0 valid = 1 adc = 4 4 - RAW SAMPLES - valid = 1 adc = 0 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80004 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 A2000026 - WINDOW RAW DATA - chan = 4 nsamples = 38 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 17C017C - RAW SAMPLES - valid = 1 adc = 380 valid = 1 adc = 380 A2800026 - WINDOW RAW DATA - chan = 5 nsamples = 38 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40008 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 8 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40000 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 0 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40000 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 0 40004 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 4 40008 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 8 40008 - RAW SAMPLES - valid = 1 adc = 4 valid = 1 adc = 8 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80008 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 8 80004 - RAW SAMPLES - valid = 1 adc = 8 valid = 1 adc = 4 A3000026 - WINDOW RAW DATA - chan = 6 nsamples = 38 C0010 - RAW SAMPLES - valid = 1 adc = 12 valid = 1 adc = 16 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 10000C - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 12 C0010 - RAW SAMPLES - valid = 1 adc = 12 valid = 1 adc = 16 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 C000C - RAW SAMPLES - valid = 1 adc = 12 valid = 1 adc = 12 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 100014 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 20 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 140010 - RAW SAMPLES - valid = 1 adc = 20 valid = 1 adc = 16 100014 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 20 140010 - RAW SAMPLES - valid = 1 adc = 20 valid = 1 adc = 16 14000C - RAW SAMPLES - valid = 1 adc = 20 valid = 1 adc = 12 140010 - RAW SAMPLES - valid = 1 adc = 20 valid = 1 adc = 16 100014 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 20 100010 - RAW SAMPLES - valid = 1 adc = 16 valid = 1 adc = 16 C000C - RAW SAMPLES - valid = 1 adc = 12 valid = 1 adc = 12 A3800026 - WINDOW RAW DATA - chan = 7 nsamples = 38 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 2C0030 - RAW SAMPLES - valid = 1 adc = 44 valid = 1 adc = 48 2C002C - RAW SAMPLES - valid = 1 adc = 44 valid = 1 adc = 44 2C002C - RAW SAMPLES - valid = 1 adc = 44 valid = 1 adc = 44 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 30002C - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 44 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 2C002C - RAW SAMPLES - valid = 1 adc = 44 valid = 1 adc = 44 2C002C - RAW SAMPLES - valid = 1 adc = 44 valid = 1 adc = 44 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 300030 - RAW SAMPLES - valid = 1 adc = 48 valid = 1 adc = 48 A4000026 - WINDOW RAW DATA - chan = 8 nsamples = 38 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 C800D0 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 208 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00C8 - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 200 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00C8 - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 200 CC00D0 - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 208 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00CC - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 204 CC00D0 - RAW SAMPLES - valid = 1 adc = 204 valid = 1 adc = 208 D000D0 - RAW SAMPLES - valid = 1 adc = 208 valid = 1 adc = 208 A5000026 - WINDOW RAW DATA - chan = 10 nsamples = 38 E400E0 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 224 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E8 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 232 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E800E4 - RAW SAMPLES - valid = 1 adc = 232 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E8 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 232 E800E8 - RAW SAMPLES - valid = 1 adc = 232 valid = 1 adc = 232 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E000E0 - RAW SAMPLES - valid = 1 adc = 224 valid = 1 adc = 224 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E4 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 228 E400E8 - RAW SAMPLES - valid = 1 adc = 228 valid = 1 adc = 232 A5800026 - WINDOW RAW DATA - chan = 11 nsamples = 38 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 C400C4 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 196 C800C4 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 196 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 C800C4 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 196 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 C800C8 - RAW SAMPLES - valid = 1 adc = 200 valid = 1 adc = 200 C400C4 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 196 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 C400C8 - RAW SAMPLES - valid = 1 adc = 196 valid = 1 adc = 200 A6000026 - WINDOW RAW DATA - chan = 12 nsamples = 38 B000AC - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 A800AC - RAW SAMPLES - valid = 1 adc = 168 valid = 1 adc = 172 AC00A8 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 168 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00B0 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 176 B000AC - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00A8 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 168 A800AC - RAW SAMPLES - valid = 1 adc = 168 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00A8 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 168 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 A800AC - RAW SAMPLES - valid = 1 adc = 168 valid = 1 adc = 172 A6800026 - WINDOW RAW DATA - chan = 13 nsamples = 38 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00B0 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 176 B000AC - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00B0 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 176 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00B0 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 176 AC00B0 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 176 B000B0 - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 176 B000B0 - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 176 B000AC - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 172 B000B0 - RAW SAMPLES - valid = 1 adc = 176 valid = 1 adc = 176 AC00AC - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 172 AC00A8 - RAW SAMPLES - valid = 1 adc = 172 valid = 1 adc = 168 A7000026 - WINDOW RAW DATA - chan = 14 nsamples = 38 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B800B8 - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 184 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B800B4 - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 180 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B800B4 - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 180 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B800BC - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 188 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B400B4 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 180 B800B4 - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 180 B800B4 - RAW SAMPLES - valid = 1 adc = 184 valid = 1 adc = 180 B400B8 - RAW SAMPLES - valid = 1 adc = 180 valid = 1 adc = 184 A7800026 - WINDOW RAW DATA - chan = 15 nsamples = 38 A0009C - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 156 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A0009C - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 156 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 9C009C - RAW SAMPLES - valid = 1 adc = 156 valid = 1 adc = 156 9C00A0 - RAW SAMPLES - valid = 1 adc = 156 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 9C009C - RAW SAMPLES - valid = 1 adc = 156 valid = 1 adc = 156 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A000A0 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 160 A400A0 - RAW SAMPLES - valid = 1 adc = 164 valid = 1 adc = 160 A400A0 - RAW SAMPLES - valid = 1 adc = 164 valid = 1 adc = 160 A400A4 - RAW SAMPLES - valid = 1 adc = 164 valid = 1 adc = 164 A000A4 - RAW SAMPLES - valid = 1 adc = 160 valid = 1 adc = 164 89000120 - BLOCK TRAILER - slot = 4 n_words = 288 value = 288 = 0x120
Hardware Trigger
Install DMA lib
Configure ROC
ld < usrTempeDma.o value = 231384032 = 0xdcaa3e0
usrVmeDmaConfig(2,2,0) 0xdccfb30 (tShell): VME DMA Address Mode set for A32 0xdccfb30 (tShell): VME DMA Transfer Mode set for D32 block mode (BLT) value = 0 = 0x0
sysVmeDmaShow() DMA Chan 0 Status = 0x00290000
Source(VME) address: 0x002b0000 Destination address: 0x0020efb4 Byte Count : 0x29007356 Execption Status : 0x00000000 Bus Error address: 0x00000000 DMA Control Reg : 0x00000000 VME Address Mode : 2 (A32) VME Data Width : 1 (D32) VME Transfer Mode: 1 (BLT32) STATUS of Last Transfer: NO Transfer Completed
value = 2686976 = 0x290000
attempts
The FADC ussing block transfers of data so you need to install the DMA library
-> interrupt: faReadBlock: WARN: DMA transfer terminated by word count 0xfa0 interrupt: ERROR: Data still in FADC (event 5, scan 0x1 csr 0xf06318e7 ) - clearing
Trying 2.6.1/extensions
copied the file tempeDma/usrTempeDma.o
and loaded it onto my 6100 ROC
ld < usrTempeDma.o
In my first attempt below I did not trigger the SIS3610 to readout so the FADC had more than 1 event in the FIFO.
-> interrupt: ERROR: Data still in FADC (event 1, scan 0x2 csr 0xf06318ef ) - clearing -> 0xdca6890 (ROC): memPartFree: invalid block 0xffffffff in partition 0x2ab41c.
on my second attempt I was more careful but go similar results
interrupt: ERROR: NO data in FADC datascan = 0x0 daLogMsg: INFO: active, events so far 1 token 0 -> -> interrupt: ERROR: Data still in FADC (event 4, scan 0x1 csr 0xf06318ef ) - clearing
On my 3rd attempt I sent only 1 trigger. Before sending the trigger I checked if there was and event using faStatus(0)
-> faStatus(0) STATUS for FADC in slot 7 at base address 0x90bb0000 -------------------------------------------------- Board Firmware Rev/ID = 0x0114 : ADC Processing Rev = 0x0909 Alternate VME Addressing: Multiblock Disabled A32 Enabled at VME base 0x08000000 or CPU addr 0x80000000 Signal Sources: Ref Clock : Front Panel Trig Src : Front Panel (Async) Sync Reset: Front Panel (Async) SDC : In Use Configuration: Internal Clock ON Bus Error DISABLED MultiBlock transfer DISABLED ADC Processing Configuration: (0x0018 0x0018) Channel Disable Mask = 0x0000 Resolution = 10 bits Mode = 1 (ENABLED) Lookback (PL) = 160 ns Time Window (PTW) = 80 ns Time Before Peak = 12 ns Time After Peak = 24 ns Max Peak Count = 1 CSR Register = 0x006318e0 Control 1 Register = 0x00030119 Control 2 Register = 0x0000000f - Enabled for triggers Internal Triggers (Live) = 0 Trigger Scaler = 0 Events in FIFO = 0 (Block level = 1) value = 44 = 0x2c = ','
now I send a trigger and get ther error message
-> interrupt: ERROR: Data still in FADC (event 2, scan 0x1 csr 0xf06318ef ) - c earing
the ROC did not crash until I send another trigger and I see
-> 0xdca6890 (ROC): memPartFree: invalid block 0xffffffff in partition 0x2ab41c.
Setup Signal distribution board
FADC and SD address
The ADC address pins are set to
Address | ||
Pin | Switch | bit |
A12 | on/closed | 0 |
A13 | on | 0 |
A14 | on | 0 |
A15 | on | 0 |
A16 | off | 1 |
A17 | off/open | 1 |
A18 | on | 0 |
A19 | off | 1 |
A20 | off | 1 |
A21 | off | 1 |
A22 | on | 0 |
A23 | off | 1 |
0xbb000 =101110110000000000000000
The signal distribution board SDC is set to
Address | ||
Pin | Switch | bit |
A6 | on/closed | 0 |
A7 | on | 0 |
A8 | on | 0 |
A9 | off | 1 |
A10 | on | 0 |
A11 | off/open | 1 |
A12 | on | 0 |
A13 | off | 1 |
A14 | off | 1 |
A15 | off | 1 |
0xea = 1110101000
Initialize FADC for Front panel(FP) trigger with Signal distribution (SD) board
The address of the SD board is passed to the faInit routine
Using the SD boards's internal clock
-> faInit(0xbb0000,0,0,0xea13) Initialized FADC 0 Slot # 7 at address 0x90bb0000 Using JLAB FADC Signal Distribution Module at address 0x9100ea00 faInit: JLAB FADC Signal Distribution Card is Assumed in Use faInit: Front Panel Inputs will be enabled. faInit: Enabling FADC for SDC Clock (Front Panel) and Front Panel Triggers (FP Sync Reset) value = 0 = 0x0
or using the FADC's internal clock
-> faInit(0xbb0000,0,0,0xea03) Initialized FADC 0 Slot # 7 at address 0x90bb0000 Using JLAB FADC Signal Distribution Module at address 0x9100ea00 faInit: JLAB FADC Signal Distribution Card will not be Used faInit: Enabling FADC Internal Clock, and Front Panel Triggers (FP Sync Reset) value = 0 = 0x0
faSDC_Status
-> faSDC_Status(0) STATUS for FADC Signal Distribution Card at base address 0x9100ea00 ---------------------------------------------------------------- Board Firmware Rev/ID = 0x02 Registers: CSR = 0x0200 Control = 0x0220 Busy Enable = 0x0000 Busy Status = 0xfe00 Ref Clock : Internal Software Triggers Software Sync Reset value = 21 = 0x15
The SDC has not been eneabled yet for external triggers.
Use faGEnable(0,0) to enable both the FADC and the SD board
-> faGEnable(0,0) value = 1 = 0x1
-> faSDC_Status(0)
STATUS for FADC Signal Distribution Card at base address 0x9100ea00
Board Firmware Rev/ID = 0x02 Registers: CSR = 0x0200 Control = 0x0200 Busy Enable = 0x0000 Busy Status = 0xfe00
Ref Clock : Internal External Triggers (Sync with clock) Software Sync Reset
value = 21 = 0x15
Set the FADC processing mode
-> faSetProcMode(7,1,40,38,3,6,1,0) value = 0 = 0x0
int faSetProcMode(int id, int pmode, unsigned int PL, unsigned int PTW, unsigned int NSB, unsigned int NSA, unsigned int NP, int bank) id = slot number =7 An example of this should be in one of the Readout lists, however, right now there are 3 viable processing modes (pmode =1,2 or 3) pmode = 1 RAW Window mode: all samples within PTW are saved pmode = 2 RAW Pulse mode: NSA+NSB+1 samples around a threshold crossing are saved. pmode = 3 Integral pulse mode: NSA+NSB+1 samples are summed and the sum along with the timestmp for the threshold crossing are saved. PL = 40 = 400 ns = latency ; time delay to record measurements after trigger is received and time window begins PTW= 20 => 80 nsecPulse Time width = time interval window for measurements = number of samples in the pulse time window NSB = 3 NSA=6 NP =1 = number of pulses Assuming the Clock is 250 MHz => clock pulse widths are 4 nsec
Enable ADC channels
-> faEnable(0,0,0) value = 0 = 0x0
Configure SD card
/*************************************************************************************** JLAB FADC Signal Distribution Card (SDC) Routines cFlag: controls the configuation of the SDC 0: Default Mode Internal CLK, Sync External Trigger and Sync Reset > 0: Pass through mode bMask: mask of Busy enables for the SDC - Do not Enable busy if there is no FADC */ int faSDC_Config(unsigned short cFlag, unsigned short bMask)
-> faSDC_Config(0,0)
value = 0 = 0x0
FADC status
-> faStatus(0) STATUS for FADC in slot 7 at base address 0x90bb0000 -------------------------------------------------- Board Firmware Rev/ID = 0x0114 : ADC Processing Rev = 0x0909 Alternate VME Addressing: Multiblock Disabled A32 Enabled at VME base 0x08000000 or CPU addr 0x80000000 Signal Sources: Ref Clock : Front Panel Trig Src : Front Panel (Async) Sync Reset: Front Panel (Async) SDC : In Use Configuration: Internal Clock ON Bus Error DISABLED MultiBlock transfer DISABLED ADC Processing Configuration: (0x0018 0x0018) Channel Disable Mask = 0x0000 Resolution = 10 bits Mode = 1 (ENABLED) Lookback (PL) = 160 ns Time Window (PTW) = 152 ns Time Before Peak = 12 ns Time After Peak = 24 ns Max Peak Count = 1 CSR Register = 0x00631ce0 Control 1 Register = 0x00030119 Control 2 Register = 0x00000007 - Enabled for triggers Internal Triggers (Live) = 0 Trigger Scaler = 0 Events in FIFO = 0 (Block level = 1) value = 44 = 0x2c = ','
Documentation
Data Format
File:JLab F250 ADC V1.2 DataFormat.pdf
Readoutlist example
___________________________________________________________________ | | | Jefferson Lab Tel: (757) 269-7159 | | Riad Suleiman FAX: (757) 269-5520 | | 12050 Jefferson Ave | | Suite 500 | | Newport News, VA 23606 Email:suleiman@jlab.org | | Text Pager: 7572893892@messaging.nextel.com | | http://www.jlab.org/~suleiman | | Home: (757) 865-0355 | ------------------------------------------------------------------- # Source for generic VME readout using a # TJNAF trigger supervisor interface register (TIR) # as a source for external interrupts # # David Abbott, TJNAF 1996 readout list VME1 maximum 16384,400 vme readout #polling #ts control const TIR_ADDR = 0x0ed0 const FADC_ADDR = 0xee0000 const FADC_BLOCK_MODE = 1 const MAX_FADC_DATA = 4000 extern int bigendian_out; extern int fadcID[20]; int FA_SLOT; begin download variable res # If the ROC is sending data to Little-Endian EB # e.g. a x86 Linux CPU then bigendian_out = 0. # Unless the ROC is also running on a Little-Endian # machine. Then set bigendian_out=1. bigendian_out = 0; # Setup TIR tirInit(TIR_ADDR); # Initialize FADC library and Modules for standalone # and Front Panel Triggers faInit(FADC_ADDR,0,1,0xea13); FA_SLOT = fadcID[0]; log inform "User Download Executed" end download begin prestart log inform "Entering User Prestart" init trig source VME link async trig source VME 1 to usrtrig and usrtrig_done event type 1 then read VME 1 # Assume FADCs have been Initialized at boot or in download # Setup FADC Programming faSetBlockLevel(FA_SLOT,1); # for Block Reads faEnableBusError(FA_SLOT); # for Single Cycle Reads # faDisableBusError(FA_SLOT); # Set All channel thresholds to 0 faSetThreshold(FA_SLOT,0,0xffff); # Setup option 1 processing - RAW Window Data <-- # option 2 - RAW Pulse Data # option 3 - Integral Pulse Data # Setup 120 nsec latency (PL = 30) # Setup 80 nsec Window (PTW = 20) # Setup Pulse widths of 36ns (NSB(3)+NSA(6) = 9) # Setup up to 1 pulse processed # Setup for both ADC banks(0 - all channels 0-15) faSetProcMode(FA_SLOT,1,40,38,3,6,1,0); # Print out status faStatus(FA_SLOT,0); log inform "User Prestart Executed" end prestart begin end CDODISABLE(VME,1,0); #FADC Disable faGDisable(0,0); #FADC Event status - Is all data read out faStatus(FA_SLOT,0); log inform "User End Executed" end end begin pause CDODISABLE(VME,1,0); log inform "User Pause Executed" end pause begin go variable outval log inform "Entering User Go" # Enable FADCs faGEnable(0,0); taskDelay(1); # Send Sync Reset to FADC faSDC_Sync(); taskDelay(1); CDOENABLE(VME,1,0); end go begin trigger usrtrig variable ii, stat, csr rol->dabufp = (long *) 0; open event type EVTYPE of BT_UI4 %% int nwrds=0; /* Check if a Block of data is available */ for(ii=0;ii<100;ii++) { stat = faBready(FA_SLOT); if (stat>0) { *rol->dabufp++ = ii; break; } } if(stat > 0) { nwrds = faReadBlock(FA_SLOT,rol->dabufp,MAX_FADC_DATA,FADC_BLOCK_MODE); if(nwrds<=0) { logMsg("ERROR: FADC Block Read Failed - Status 0x%x\n",nwrds,0,0,0,0,0); *rol->dabufp++ = 0xda000bad; faClear(FA_SLOT); } else { rol->dabufp += nwrds; } }else{ *rol->dabufp++ = 0xfa000bad; logMsg("ERROR: NO data in FADC datascan = 0x%x\n",stat,0,0,0,0,0); faClear(FA_SLOT); } /* Check that there is no data left */ stat = faDready(FA_SLOT); if(stat>0) { csr = faReadCSR(FA_SLOT); logMsg("ERROR: Data still in FADC (event %d, scan 0x%x csr 0x%x ) - clearing\n", *(rol->nevents),stat,csr,0,0,0); faClear(FA_SLOT); } %% close event end trigger begin done usrtrig end done begin done # Acknowledge tir register CDOACK(VME,1,0); end done begin status end status
ROC library
V 1.2
sample readout list:Media:fadc_list.crl.txt
DMA library
dmaPList.c: Media:JLab_F250_ADC_dmaPlist.c.txt
dmaPList.h: Media:JLab_F250_ADC_dmaPlist.h.txt
ROC library
fadcLib.c: Media:JLab_F250_ADC_fadcLib.c.txt
fadcLib.h: Media:JLab_F250_ADC_fadcLib.h.txt