Configuration

After a TimeTagger4 device has been initialized (see Initialization), it must be configured before it can acquire data.

To configure a TimeTagger4 device:

The following example shows a basic configuration of an already initialized TimeTagger4 device using the default configuration parameters. A complete coding example can be found on github.com/cronologic-de/xtdc_babel or in Section Code Example.

// get a default set of configuration parameters
timetagger4_configuration config;
status = timetagger4_get_default_configuration(device, &config);
if (status != TIMETAGGER4_OK) { /* handle error */ }

// configure the device
status = timetagger4_configure(device, &config);
if (status != TIMETAGGER4_OK) { /* handle error */ }

timetagger4_configure

int timetagger4_configure(timetagger4_device *device, timetagger4_configuration *config)

Configures a TimeTagger4 device.

Parameters:
  • device – Pointer to a TimeTagger4 device.

  • config – Pointer to a timetagger4_configuration struct used for the configuration.

Returns:

Status code: TIMETAGGER4_OK, TIMETAGGER4_INVALID_DEVICE, TIMETAGGER4_HARDWARE_FAILURE, or TIMETAGGER4_INVALID_CONFIG_PARAMETERS.

timetagger4_get_default_configuration

int timetagger4_get_default_configuration(timetagger4_device *device, timetagger4_configuration *config)

Obtain a default set of configuration parameters.

Parameters:
Returns:

Status code: TIMETAGGER4_OK, TIMETAGGER4_INVALID_DEVICE, or TIMETAGGER4_CRONO_INVALID_ARGUMENTS.

timetagger4_get_current_configuration

int timetagger4_get_current_configuration(timetagger4_device *device, timetagger4_configuration *config)

Obtain the current set of configuration parameters of an already configured TimeTagger4 device.

Parameters:
  • device – Pointer to a configured TimeTagger4 device.

  • config – Pointer to a timetagger4_configuration struct that will be filled.

Returns:

Status code: TIMETAGGER4_OK, or TIMETAGGER4_INVALID_DEVICE.

timetagger4_configuration

struct timetagger4_configuration

This struct is used to configure a TimeTagger4 device using timetagger4_configure().

int size

The number of bytes this struct occupies.

int version

Version number of this struct. It is increased when the definition of the struct changes.

int tdc_mode

Operational mode of the TDC.

Must be one of the following:

TIMETAGGER4_TDC_MODE_GROUPED

Operate in grouped mode.

Classical Common-Start operation. See also Grouping and Events.

TIMETAGGER4_TDC_MODE_CONTINUOUS

Operate in continuous mode. Only available for Gen 2.

See also Continuous Mode.

auto_trigger_period must be set appropriately.

The time corresponding to channel[i].stop must be larger than the time corresponding to auto_trigger_period, otherwise not all hits on channels[i] will be recorded. You can achieve this easily by setting stop to the maximum possible value (0xffffffff).

crono_bool_t start_rising

Not applicable for the TimeTagger4. Rising and/or falling edges are configured using timetagger4_trigger.

double dc_offset[TIMETAGGER4_TDC_CHANNEL_COUNT + 1]

Set the threshold voltage for the input channels S, A–D.

See also Figure 4.

  • dc_offset[0]: Threshold for channel Start.

  • dc_offset[1-4]: Thresholds for Stop channels A–D.

The supported range is –1.27 to 1.13 V.

The threshold should be close to 50% of the height of the input pulse.

The effective resolution is about \(\pm\) 4 mV.

Note

The inputs are AC coupled. Thus, the absolute voltage is not important for pulse inputs. It is the relative pulse amplitude that causes the input circuit to switch. The parameter must be set to the relative switching voltage for the input standard in use.

If the pulses are negative, a negative switching threshold must be set and vice versa.

Attention

The supported range changed for driver release 1.10.7. That means, if you use a value for dc_offset outside the new supported range in your source code, the device configuration will adjust it automatically to the new supported range (e.g., a value of 1.18 V will be reduced to 1.13 V).

Values for various signaling standards are provided as macros:

TIMETAGGER4_DC_OFFSET_P_NIM

DC offset is set to 0.35 V.

TIMETAGGER4_DC_OFFSET_P_CMOS

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_LVCMOS_33

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_LVCMOS_25

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_LVCMOS_18

DC offset is set to 0.90 V.

TIMETAGGER4_DC_OFFSET_P_TTL

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_LVTTL_33

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_LVTTL_25

DC offset is set to 1.13.

TIMETAGGER4_DC_OFFSET_P_SSTL_3

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_P_SSTL_2

DC offset is set to 1.13 V.

TIMETAGGER4_DC_OFFSET_N_NIM

DC offset is set to –0.35 V.

TIMETAGGER4_DC_OFFSET_N_CMOS

DC offset is set to –1.27 V.

TIMETAGGER4_DC_OFFSET_N_LVCMOS_33

DC offset is set to –1.27 V.

TIMETAGGER4_DC_OFFSET_N_LVCMOS_25

DC offset is set to –1.25 V.

TIMETAGGER4_DC_OFFSET_N_LVCMOS_18

DC offset is set to –0.90 V.

TIMETAGGER4_DC_OFFSET_N_TTL

DC offset is set to –1.27 V.

TIMETAGGER4_DC_OFFSET_N_LVTTL_33

DC offset is set to –1.27 V.

TIMETAGGER4_DC_OFFSET_N_LVTTL_25

DC offset is set to –1.25 V.

TIMETAGGER4_DC_OFFSET_N_SSTL_3

DC offset is set to –1.27 V.

TIMETAGGER4_DC_OFFSET_N_SSTL_2

DC offset is set to –1.25 V.

timetagger4_trigger trigger[TIMETAGGER4_TRIGGER_COUNT]

Configuration of the polarity of the external trigger sources.

External trigger sources are used as inputs for the TiGer blocks and as inputs to the time measurement unit.

Index 0 refers to the Start channel, indices 1 through 4 to the Stop channels A through D.

timetagger4_tiger_block tiger_block[TIMETAGGER4_TIGER_COUNT]

Configuration of the Timing Generators.

Index 0 refers to the TiGer connected to the Start channel, indices 1 through 4 to the TiGer-Units connected to the Stop channels A through D.

timetagger4_channel channel[TIMETAGGER4_TDC_CHANNEL_COUNT]

Configuration of the Stop channels.

Indices 0 through 3 refer to the Stop channels A through D.

timetagger4_lowres_channel lowres_channel[TIMETAGGER4_LOWRES_CHANNEL_COUNT]

Not applicable for the TimeTagger4.

This field is part of the struct to ensure driver compatibility with other cronologic boards.

uint32_t auto_trigger_period

Configure the base frequency of the auto trigger function generator.

See also auto_trigger_random_exponent.

uint32_t auto_trigger_random_exponent

Configure the randomness of the auto trigger function generator.

There is no enable or reset of the auto trigger.

Given the two parameters auto_trigger_period (M) and auto_trigger_random_exponent (N), the frequency T of the auto trigger function generator will be

\[T = M + [1 \dots 2^N] - 1\]

Depending on tdc_mode, the following restrictions apply

TIMETAGGER4_TDC_MODE_GROUPED

Mmin \(\le\) M < 232 and 0 \(\le\) N < 32

Mmin is 6 for Gen 1 and 8 for Gen 2.

TIMETAGGER4_TDC_MODE_CONTINUOUS

31 \(\le\) M < 78125000 and 0 \(\le\) N < 32

M and N are given in units of timetagger4_static_info.auto_trigger_ref_clock.

Note

The auto trigger can be used as a source of the TiGer blocks (timetagger4_tiger_block.sources).

timetagger4_delay_config delay_config[TIMETAGGER4_TDC_CHANNEL_COUNT + 1]

Configuration of the channel delays.

Index 0 refers to the Start channel, indices 1 through 4 to the Stop channels A through D.

uint32_t ignore_empty_packets

If enabled (any value but 0), do not write empty packets to the output stream.

Disabled by default.

timetagger4_trigger

struct timetagger4_trigger

Configure if rising or falling or both edges create a trigger event for timetagger4_tiger_block.

crono_bool_t falling

Falling edges will trigger an event.

crono_bool_t rising

Rising edges will trigger an event.

timetagger4_tiger_block

struct timetagger4_tiger_block

This struct configures the Timing Generators [see also Timing Generators (TiGer)].

crono_bool_t enable

Activates the TiGer.

Note

To use a TiGer, make sure to also set enable_lemo_output to true.

crono_bool_t negate

Inverts the output polarity.

Default is false.

crono_bool_t retrigger

Enables re-triggering.

If re-triggering is enabled, the following applies: After an event triggered the TiGer output, another event that is detected before the stop value is reached will extend the TiGer output for a time stop minus start.

crono_bool_t extend

Not applicable for the TimeTagger4.

crono_bool_t enable_lemo_output

Enables the LEMO output.

Drive the TiGer signal to the corresponding LEMO connector as an output.

Pulses created by the TiGer are visible at the corresponding input and can be used to get their exact timing.

Attention

The output is DC coupled. Make sure to not connect any devices to the corresponding input, as this may damage the device or the TimeTagger4.

uint_32_t start

Configure the duration when the TiGer output is enabled relative to the trigger.

See also stop.

uint_32_t stop

Configure the duration when the TiGer output is enabled relative to the trigger.

In multiplies of 4 ns for Gen 1 and 3.2 ns for Gen 2.

The range is 0 \(\le\) start \(\le\) stop \(\le\) 216 – 1.

After a trigger event, a timer starts. Once the timer reaches start, the TiGer activates. Once the timer reaches stop, the TiGer deactivates.

If another trigger event is detected before the timer reaches stop and retrigger is true, the timer resets to start.

int sources

A bitmask with a bit set for all trigger sources that can trigger this TiGer block.

Default is TIMETAGGER4_TRIGGER_SOURCE_S.

Possible trigger sources are:

TIMETAGGER4_TRIGGER_SOURCE_S

0x00000001. If this bit is set, the Start channel can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_A

0x00000002. If this bit is set, Stop channel A can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_B

0x00000004. If this bit is set, Stop channel B can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_C

0x00000008. If this bit is set, Stop channel C can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_D

0x00000010. If this bit is set, Stop channel D can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_AUTO

0x00004000. If this bit is set, the auto trigger function generator can trigger the TiGer block.

TIMETAGGER4_TRIGGER_SOURCE_ONE

0x00008000. If this bit is set, the TiGer block is triggered every clock cycle.

For example, if you want the Start channel and the auto trigger to trigger the TiGer block:

int bitmask = TIMETAGGER4_TRIGGER_SOURCE_S | TIMETAGGER4_TRIGGER_SOURCE_AUTO;
config.tiger_block[i].sources = bitmask;

timetagger4_channel

struct timetagger4_channel
crono_bool_t enabled

Enable the TDC channel.

crono_bool_t rising

Not applicable for the TimeTagger4.

Rising and/or falling edges are configured using timetagger4_trigger.

uint32_t start

Start value for the grouping functionality.

In multiples of timetagger4_param_info.binsize.

See also stop and Grouping and Events.

uint32_t stop

Stop value for the grouping functionality.

In multiples of timetagger4_param_info.binsize.

Only hits between start and stop are read out.

For Gen 1, the range is 0 ≤ startstop ≤ 231.

For Gen 2, the range is 0 ≤ startstop ≤ 232.

See also Grouping and Events.

timetagger4_delay_config

struct timetagger4_delay_config

Only available for TimeTagger4 Gen 2.

uint32_t delay

Delay the corresponding input channel.

In units of timetagger4_static_info.delay_bin_size.

The range is 0 \(\le\) delay \(\le\) 1023.

See also Configurable Input Delay.