Skip to content

Hardware Link (caen.board)

caen.board

Board-level register map and configuration presets for CAEN DT5780 DPP-PHA.

BOARD

Container for board-level DPP-PHA register definitions and default settings.

Note

Board-level register configurations reside in volatile FPGA memory and are reset upon power-cycle or software reset.

Attributes:

Name Type Description
cfg dict[str, dict]

Mapping of parameter names to register addresses, bitfields, units, and GUI metadata.

clock int

ADC sampling clock period in nanoseconds (10 ns for 100 MS/s).

Source code in caen/board.py
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
class BOARD:
    """Container for board-level DPP-PHA register definitions and default settings.

    Note:
        Board-level register configurations reside in volatile FPGA memory and are
        reset upon power-cycle or software reset.

    Attributes:
        cfg (dict[str, dict]): Mapping of parameter names to register addresses,
            bitfields, units, and GUI metadata.
        clock (int): ADC sampling clock period in nanoseconds (``10`` ns for 100 MS/s).
    """
    cfg, clock = {}, 10  # ADC clock in ns


    # =====================================================================================================================
    section = "hidden"
    cfg["Data Flush"] = {"addr": 0x803C, "mode": "w", "init": 1, "menu": section}
    cfg["Software Reset"] = {"addr": 0xEF24, "mode": "w", "init": 1, "menu": section}
    cfg["Software Clear"] = {"addr": 0xEF28, "mode": "w", "init": 1, "menu": section}
    cfg["Start/Stop"] = {
        "addr": 0x8100,
        "bits": (2, 1),
        "init": "Stop (Disarm)",
        "pick": {
            "Stop (Disarm)":  [0x0, "Acquisition STOP (or DISARM)."],
            "Start (Arm)":    [0x1, "Acquisition START (or ARM)."],
        },
        "menu": section,
    }

    cfg["Energy"] = {
        "addr": 0x8000,
        "bits": (17, 1),
        "init": 1,
        "menu": section,
#        "init": "Enabled",
#        "pick": {
#            "Disabled": [0x0, "The height of the trapezoid is not saved."],
#            "Enabled": [0x1, "The height of the trapezoid is saved into the event data."],
#        },
    }

    cfg["Time Stamp"] = {
        "addr": 0x8000,
        "bits": (18, 1),
        "init": 1,
        "menu": section,
#        "init": "Enabled",
#        "pick": {
#            "Disabled": [0x0, "The time stamp of the event is not saved."],
#            "Enabled": [0x1, "The time stamp of the event is saved into the event data."],
#        },
    }

    cfg["Waveform"] = {
        "addr": 0x8000,
        "bits": (16, 1),
        "init": 1,
        "menu": section,
#        "init": "Enabled",
#        "pick": {
#            "Disabled": [0x0, "The waveforms are not recorded."],
#            "Enabled": [
#                0x1,
#                "Enables the waveform recording. According to the Dual Trace option one or two waveforms are saved.",
#            ],
#        },
    }

    cfg["Dual Trace"] = {
        "addr": 0x8000,
        "bits": (11, 1),
        "init": 1,
        "menu": section,
#        "init": "Enabled",
#        "pick": {
#            "Disabled": [
#                0x0,
#                "In oscilloscope or mixed mode, it is possible to plot two different waveforms.",
#            ],
#            "Enabled": [
#                0x1,
#                "The samples of the two signals are interleaved, thus each waveform is recorded at half of the ADC frequency.",
#            ],
#        },
    }

    cfg["Aggregates in all"] = {
        "addr": 0x800C,
        "mode": "rw",
        "init": 0xA,
        "menu": section,
#        "init": "1 aggr",
#        "pick": {
#            "1 aggr":      [0x0, "Do not use aggregates."],
#            "4 aggr":      [0x2, "Divide memory into 4 aggregates."],
#            "8 aggr":      [0x3, "Divide memory into 8 aggregates."],
#            "16 aggr":     [0x4, "Divide memory into 16 aggregates."],
#            "32 aggr":     [0x5, "Divide memory into 32 aggregates."],
#            "64 aggr":     [0x6, "Divide memory into 64 aggregates."],
#            "128 aggr":    [0x7, "Divide memory into 128 aggregates."],
#            "256 aggr":    [0x8, "Divide memory into 256 aggregates."],
#            "512 aggr":    [0x9, "Divide memory into 512 aggregates."],
#            "1024 aggr":   [0xA, "Divide memory into 1024 aggregates."],
#        },
    }

    cfg["Aggregates per BLT"] = {
        "addr": 0xEF1C,
        "mode": "rw",
#        "mask": 0x3FF,
        "init": 1024,
        "menu": section,
#        "unit": [1, "aggr"],
#        "ttip": "This sets the maximum number of complete aggregates which has to be transferred for each block transfer."
    }


    # =====================================================================================================================
    section = "Waveform Settings"
    cfg["Record Length"] = {
        "addr": 0x8020,
        "mode": "rw",
        "mask": 0xFFFF,
        "min_": 4,
        "init": 32,
        "unit": [2, "samples"],
        "ttip": "Number of samples in the waveform.",
        "menu": section,
    }

    cfg["Analog Probe 1"] = {
        "addr": 0x8000,
        "bits": (12, 2),
        "init": "Input",
        "pick": {
            "Input": [0x0, "Analog Input."],
            "RC-CR": [0x1, "Input 1st derivative."],
            "RC-CR2": [0x2, "Input 2nd derivative."],
            "Trapezoid": [0x3, "Output of the Trapezoid Filter."],
        },
        "menu": section,
    }

    cfg["Analog Probe 2"] = {
        "addr": 0x8000,
        "bits": (14, 2),
        "init": "Input",
        "pick": {
            "Input": [0x0, "Input"],
            "Threshold": [0x1, "Threshold referred to the RC‐CR2 signal."],
            "Trapezoid ‐ Baseline": [0x2, "Trapezoid with substructed Baseline."],
            "Baseline": [0x3, "Baseline of the Trapezoid."],
        },
        "menu": section,
    }

    cfg["Digital Probe"] = {
        "addr": 0x8000,
        "bits": (20, 4),
        "init": "TVAW",
        "pick": {
            "Peaking": [0x0, "Shows where the energy is calculated"],
            "Armed": [0x1, "Shows where the Timing Filter crosses the Threshold"],
            "Peak Run": [0x2, "Starts with the trigger and last for the whole event"],
            "Pile-Up": [0x3, "Shows where a pile‐up event occurred"],
            #        "Peaking": [0x4,              "Shows where the energy is calculated"],
            "TVAW": [0x5, "Shows the trigger validation acceptance window"],
            "Baseline Freeze": [
                0x6,
                "Shows where the algorithm stops calculating the baseline and its value is frozen",
            ],
            "Trigger Holdoff": [0x7, "Shows the trigger hold‐off time"],
            "Trigger Validation": [0x8, "Shows the trigger validation signal"],
            "Acquisition Busy": [
                0x9,
                "Saturated input signal or full memory board or there is a veto",
            ],
            "Zero Crossing Window": [
                0xA,
                "Shows the Zero Crossing Acceptance Windows width",
            ],
            "External Trigger": [0xB, "Shows the external trigger, when available"],
            "Busy": [0xC, "Shows when the board memory is full"],
            "Peak Ready": [0xD, "Shows after the Peak Mean time"],
        },
        "menu": section,
    }


    # =====================================================================================================================
    section = "Acquisition Control"
    cfg["Channel Enable"] = {
        "addr": 0x8120,
        "mode": "rw",
#        "bits": (0, 31), # after reset we read 0xC here, why?
        "init": "Both channels",
        "pick": {
            "Channel 0":  [0x1, "Channel 0 enabled, channel 1 disabled."],
            "Channel 1":  [0x2, "Channel 0 disabled, channel 1 enabled."],
            "Both channels":  [0x3, "Both channels enabled."],
        },
        "menu": section,
    }


    cfg["Auto Data Flush"] = {
        "addr": 0x8000,
        "mode": "rw",
        "bits": (0, 1),
        "init": "Disabled",
        "pick": {
            "Disabled": [0x0, "Data readout occurs only if the events buffer is full."],
            "Enabled": [
                0x1,
                "In case of very slow rate forces the automatic data readout in a time window of 16‐32 ms. Causes incomplete readout!!!",
            ],
        },
        "menu": section,
    }

    cfg["Trigger Propagation"] = {
        "addr": 0x8000,
        "bits": (2, 1),
        "init": "Enabled",
        "pick": {
            "Disabled": [
                0x0,
                "Disables the propagation of the individual trigger from motherboard logic to the mezzanine.",
            ],
            "Enabled": [0x1, "Enable is required for coincidence trigger mode."],
        },
        "menu": section,
    }

    cfg["Start/Stop Mode"] = {
        "addr": 0x8100,
        "bits": (0, 2),
        "init": "Software",
        "pick": {
            "Software": [0x0, "Software controlled acquisition."],
            "GPI":      [0x1, "Acquisition is controlled by General Purpose Input."],
            "TRG-IN":   [0x2, "Acquisition is controlled by Trigger Input."],
        },
        "menu": section,
    }

    cfg["Clock Source"] = {
        "addr": 0x8100,
        "bits": (6, 1),
        "init": "Internal",
        "pick": {
            "Internal": [0x0, "Internal oscillator (50 MHz)."],
            "External": [0x1, "External clock from CLK‐IN connector."],
        },
        "menu": section,
    }

    # =====================================================================================================================
    section = "Experiment Control"
    cfg["Readout Span"] = {
        "mask": 0x3FFF,
        "min_": 100,
        "init": 1000,
        "unit": [1, "ms"],
        "ttip": "Readout occures once per this time.",
        "menu": section,
    }

    cfg["Stop Run by"] = {
        "init": "Real Time",
        "pick": {
            "Manually":      [0x0, "Press «Stop» and «Save» buttons manually."],
            "Real Time":     [0x1, "Run will stop when «Real Time» reaches «Run Duration»."],
            "Live Time CH0": [0x2, "Run will stop when «Live Time CH0» reaches «Run Duration»."],
            "Live Time CH1": [0x3, "Run will stop when «Live Time CH1» reaches «Run Duration»."],
            },
        "menu": section,
     }

    cfg["Run Duration"] = {
        "mask": 0xFFFF,
        "min_": 1,
        "init": 600,
        "unit": [1, "s"],
        "ttip": "Total acquisition time.",
        "menu": section,
    }

    cfg["Repeat Runs"] = {
        "init": "Enable",
        "pick": {
            "Disable": [0x0, "No resume after run ends."],
            "Enable":  [0x1, "Start new run after run ends."],
            },
        "menu": section,
    }

    cfg["Save Histograms"] = {
        "init": "Enable",
        "pick": {
            "Disable": [0x0, "Don't save histograms to disk."],
            "Enable":  [0x1,  "Save histograms to disk."],
            },
        "menu": section,
    }

    cfg["Save Rates"] = {
        "init": "Disable",
        "pick": {
            "Disable": [0x0, "Don't save rates to disk."],
            "Enable":  [0x1,  "Save rates to disk."],
            },
        "menu": section,
    }

    cfg["Save Events"] = {
        "init": "Disable",
        "pick": {
            "Disable": [0x0, "Don't save events to disk."],
            "Enable":  [0x1,  "Save events (list mode) to disk."],
            },
        "menu": section,
    }

    cfg["Coincidence Mode"] = {
        "init": "Disable",
        "pick": {
            "Disable":  [0x0, "Either one or both channels are measured independently."],
            "Enable":   [0x1, "When two-channel operation, each channel spectrum is drawn in coicidense with the other channel. Coincidence rate is displayed."],
            },
        "menu": section,
    }

    cfg["Coincidence Gate"] = {
        "mask": 0xFF,
        "min_": 0,
        "init": 0,
        "unit": [clock, "ns"],
        "ttip": "Software coincidence gate.",
        "menu": section,
    }

    cfg["Amplitude Units"] = {
        "init": "ch",
        "pick": {
            "ch":   [0x0, "MCA channels"],
            "keV":  [0x2, "kilo electron Volts"],
            },
        "menu": section,
    }

    # =====================================================================================================================
    section = "Global Trigger Mask"
    cfg["GTM Channel 0"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (0, 1),
        "init": "Enabled",
        "pick": {
            "Disabled":  [0x0, "Disables the trigger request from Channel 0 to participate to the global trigger logic."],
            "Enabled":   [0x1, "Enables the trigger request from Channel 0 to participate to the global trigger logic."],
            },
        "menu": section,
     }

    cfg["GTM Channel 1"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (1, 1),
        "init": "Enabled",
        "pick": {
            "Disabled":  [0x0, "Disables the trigger request from Channel 1 to participate to the global trigger logic."],
            "Enabled":   [0x1, "Enables the trigger request from Channel 1 to participate to the global trigger logic."],
            },
        "menu": section,
    }

    cfg["GTM External"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (30, 1),
        "init": "Disabled",
        "pick": {
            "Disabled":  [0x0, "Disables the external trigger on TRG‐IN to participate in the global trigger generation in logic OR with the other enabled signals."],
            "Enabled":   [0x1, "Enables the external trigger on TRG‐IN to participate in the global trigger generation in logic OR with the other enabled signals."],
            },
        "menu": section,
    }

    cfg["GTM Software"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (31, 1),
        "init": "Disabled",
        "pick": {
            "Disabled":  [0x0, "Disables the software trigger to participate in the global trigger generation in logic OR with the other enabled signals."],
            "Enabled":   [0x1, "Enables the software trigger to participate in the global trigger generation in logic OR with the other enabled signals."],
            },
        "menu": section,
    }

    cfg["GTM Majority Window"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (20, 4),
        "mask": 0xF,
        "min_": 0,
        "unit": [clock, "ns"],
        "init": 20,
        "ttip": "Sets the time window for the majority coincidence. Majority level must be set different from 0.",
        "menu": section,
    }

    cfg["GTM Majority Level"] = {
        "addr": 0x810C,
        "mode": "rw",
        "bits": (24, 3),
        "mask": 0x7,
        "min_": 0,
        "unit": [1, ""],
        "init": 0,
        "ttip": "Sets the majority level for the global trigger generation. For a level M, the trigger fires when at least M+1 of the trigger requests are generated by the enabled channels.",
        "menu": section,
    }


    # =====================================================================================================================
    section = "GPO Trigger Mask"
    cfg["GPO Channel 0"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (0, 1),
        "init": "Enabled",
        "pick": {
            "Disabled":  [0x0, "Disables the trigger request from Channel 0 to participate to the TRG‐OUT logic."],
            "Enabled":   [0x1, "Enables the trigger request from Channel 0 to participate to the TRG‐OUT logic."],
            },
        "menu": section,
     }

    cfg["GPO Channel 1"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (1, 1),
        "init": "Enabled",
        "pick": {
            "Disabled":  [0x0, "Disables the trigger request from Channel 1 to participate to the TRG‐OUT logic."],
            "Enabled":   [0x1, "Enables the trigger request from Channel 1 to participate to the TRG‐OUT logic."],
            },
        "menu": section,
    }

    cfg["GPO External"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (30, 1),
        "init": "Disabled",
        "pick": {
            "Disabled":  [0x0, "Disables the external trigger to participate in the TRG‐OUT (GPO) generation in logic OR with the other enabled signals."],
            "Enabled":   [0x1, "Enables the external trigger to participate in the TRG‐OUT (GPO) generation in logic OR with the other enabled signals."],
            },
        "menu": section,
    }

    cfg["GPO Software"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (31, 1),
        "init": "Disabled",
        "pick": {
            "Disabled":  [0x0, "Disables the software trigger to participate in the TRG‐OUT (GPO) generation in logic OR with the other enabled signals."],
            "Enabled":   [0x1, "Enables the software trigger to participate in the TRG‐OUT (GPO) generation in logic OR with the other enabled signals."],
            },
        "menu": section,
    }

    cfg["GPO Logic"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (8, 2),
        "init": "OR",
        "pick": {
            "OR":       [0x0, "The enabled trigger requests can be combined to generate the TRG‐OUT (GPO) signal."],
            "AND":      [0x1, "The enabled trigger requests can be combined to generate the TRG‐OUT (GPO) signal."],
            "Majority": [0x2, "The enabled trigger requests can be combined to generate the TRG‐OUT (GPO) signal."],
            },
        "menu": section,
    }

    cfg["GPO Majority Level"] = {
        "addr": 0x8110,
        "mode": "rw",
        "bits": (10, 3),
        "mask": 0x7,
        "min_": 0,
        "unit": [1, ""],
        "init": 0,
        "ttip": "Sets the majority level for the TRG‐OUT (GPO) generation. For a level M, the trigger fires when at least M+1 of the trigger requests are generated by the enabled channels.",
        "menu": section,
    }


    # =====================================================================================================================
    section = "Front Panel I/O"
    cfg["LEMO I/O Level"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (0, 1),
        "init": "NIM",
        "pick": {
            "NIM": [0x0, "This sets the NIM electrical levels of the front panel LEMO connectors: TRG‐IN, TRG‐OUT (GPO ), S‐IN (GPI)."],
            "TTL": [0x1, "This sets the TTL electrical levels of the front panel LEMO connectors: TRG‐IN, TRG‐OUT (GPO ), S‐IN (GPI)."],
            },
        "menu": section,
    }

    cfg["TRG‐IN control"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (10, 1),
        "init": "Edge",
        "pick": {
            "Edge":  [0x0, "Trigger is synchronized with the edge of the TRG‐IN signal."],
            "Whole": [0x1, "Trigger is synchronized with the whole duration of the TRG‐IN signal."],
            },
        "menu": section,
    }

    cfg["TRG‐IN goes to"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (11, 1),
        "init": "Motherboard",
        "pick": {
            "Motherboard":  [0x0, "TRG‐IN signal is processed by the motherboard and sent to mezzanine (default). The trigger logic is then synchronized with TRG‐IN."],
            "Mezzanines": [0x1, "TRG‐IN is directly sent to the mezzanines with no mother board processing nor delay. This option can be useful when TRG‐IN is used to veto the acquisition. Note: TRG‐IN control is ignored."],
            },
        "menu": section,
    }

    cfg["Force TRG‐OUT to"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (14, 1),
        "init": "0",
        "pick": {
            "0": [0x0, "This bit can force TRG‐OUT (GPO) test logical level to 0 if TRG‐OUT Mode is 1."],
            "1": [0x1, "This bit can force TRG‐OUT (GPO) test logical level to 1 if TRG‐OUT Mode is 1."],
            },
        "menu": section,
    }

    cfg["TRG‐OUT Mode"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (15, 1),
        "init": "Internal",
        "pick": {
            "Internal": [0x0, "TRG‐OUT (GPO) is an internal signal according to TRG‐OUT Mode Selection."],
            "Test": [0x1, "TRG‐OUT (GPO) is a test logic level set via Force TRG‐OUT."],
            },
        "menu": section,
    }

    cfg["TRG‐OUT Selection"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (16, 2),
        "init": "Trigger",
        "pick": {
            "Trigger": [0x0, "TRG‐OUT/GPO propagates the internal trigger sources according to GPO Enable Mask."],
            "Motherboard": [0x1, "Motherboard Probes: TRG‐OUT/GPO is used to propagate signals of the motherboards according to Motherboard Virtual Probe Selection."],
            "Channel": [0x2, "TRG‐OUT/GPO is used to propagate signals of the mezzanines (Channel Signal Virtual Probe)."],
            "GPI": [0x3, "S‐IN (GPI) propagation."],
            },
        "menu": section,
    }

    cfg["Motherboard Probe"] = {
        "addr": 0x811C,
        "mode": "rw",
        "bits": (18, 2),
        "init": "RUN",
        "pick": {
            "RUN": [0x0, "This is the RUN in case of ROC FPGA firmware rel. less than 4.12. This probe can be selected according to Run / Delayed Run."],
            "CLKOUT": [0x1, "This clock is synchronous with the sampling clock of the ADC and can be used to align the phase of the clocks in different boards."],
            "CLK Phase": [0x2, "TRG‐OUT/GPO is used to propagate signals of the mezzanines (Channel Signal Virtual Probe)."],
            "BUSY/UNLOCK": [0x3, "This is the board BUSY in case of ROC FPGA firmware rel. 4.5 or lower. This probe can be selected according to."],
            },
        "menu": section,
    }