This firmware allows an arduino to be used as a controller of the digital potentiometer on the SiPMTrigger board as well as a simple scaler. Please note: The combination of slow control and data aquisition by the same hardware has several drawbacks, but can be choosen if handled carefully.
Currently there are two versions of the SiPMTrigger board (Scinti_Readout v1 and Scinti_Readout v2). Due to different channel mappings,
each board requires its own firmware. Please edit the line #define SCINTI_READOUT_HW_VERSION 2 according to your needs.
This sketch depends on the following libraries:
- FreqCount
- RTClib
- LiquidCrystal (included in the Arduino IDE)
- OneWire
- DallasTemperature
- AnotherSerialCommand
- SPI (included in the Arduino IDE)
- SparkFun BME280
- AD5144
In the follwing table the arduino pins used by this sketch are listed.
| Arduino pin | Pin Mode | Function |
|---|---|---|
| 47 | input | Frequency counter input |
| 53 | output | Chip Select to SiPM Trigger board (potentiometer IC) |
| MISO, MOSI, SCK, +5V, GND (ICSP header) | both | SPI to SiPM Trigger board |
| SDA, SCL, +3.3V, GND | both | I2C to BME280 environmental sensor |
The SiPMTrigger Controller can be controlled interactively via a serial terminal (e.g. minicom/Cutecom). The required serial settings are:
Baud rate | 9600 Data bits | 8 Parity | None Stop bits | 1 Handshake | None
The following table lists all available commands. For command execution send a newline character.
| Comand | Description |
|---|---|
SET THR $CH, $THR |
Set the threshold of signal channel $CH to $THR. |
SET OFFSET $CH, $VAL |
Set the offset of signal channel $CH to $VAL. |
SET GAIN $CH, $VAL |
Set the gain of signal channel $CH to $VAL. |
SET PE THR $CH, $PETHR |
Set the threshold of signal channel $CH to $PETHR * $GAIN. |
SCAN THR $CH |
Scan the threshold of signal channel CH by increasing the threshold by 1LSB per step. |
SCAN PE THR |
Scan the thresholds of both signal channels simultaneously from 0p.e. up to the highest possible treshold by increasing them by 0.1p.e. at each tick. |
SET TIME $INTTIME |
Set the integrating time interval to $INTTIME (in milliseconds). |
GET TEMP |
Measure the temperature, humidity and pressure and print the results on the serial console. |
Example:
# SiPMTrigger v4 Control v0.7pre
# RTC is NOT running!
# CH1(THR) CH2(THR) CH1(THR/pe) CH2(THR/pe) counts sqrt(counts)
128 128 128.00 128.00 0.00 0.00
128 128 128.00 128.00 0.00 0.00
128 128 128.00 128.00 0.00 0.00
128 128 128.00 128.00 0.00 0.00
8 0 8.00 0.00 2273990.00 1507.98
8 0 8.00 0.00 2263700.00 1504.56
The output contains the threshold settings of the discriminator for both signal channels, as well as the trigger rate with error of the signal on the frequency input pin in the last integration time interval.
The following table shows the mapping of internal potentiometer channels to their function on the different boards.
| Potentiometer channel | Function |
|---|---|
| channel 0 | signal channel 1 pulse width |
| channel 1 | signal channel 2 threshold |
| channel 2 | signal channel 1 threshold |
| channel 3 | signal channel 2 pulse width |
| Potentiometer channel | Function |
|---|---|
| channel 0 | signal channel 1 threshold |
| channel 1 | signal channel 2 threshold |
The SiPMTrigger Controller is controlled with the python scripts provided in the folter contrib.
To be able to use these scripts, a capacitor has to be added between the RESET and GND pin of the Arduino
to prevent a reset of the microcontroller after each command execution.
The following commands are available:
Licensed under the GPLv3 or later.