mtdc -- Mesytec 32/34 channel TDC


mtdc create name ?options...?

mtdc config name option value ?...?

mtdc cget name


The MTDC32 is a multi hit time digitizer from Mesytec. It has two fundamentally different modes of operation; trigger matching and timestamping

In trigger matching mode you establish a time window relative to gate inputs. Hits which occur during that time window are accepted and the hit time relative to the gate is returned for each hit. By placing the time window correcty it is possible to use this mode to simulate a common start or common stop TDC. The module can run as two separate 16 channel logical modules or as a single 32 channel module.

In timestamping mode, all hits are digitized and their times relative to the most recent time clear are returned. In timestamping mode, the gate inputs are simply another pair of inputs making the module a 34 channel module when used for timestamping.

The module is very flexible and setup can be complex so it is important that you understand the MTDC32 manual when reading this documentation.

The mtdc command is a typical VM-USB device support command. It provides a create sub-command for generating module instances, a config sub-command for configuring module instances and a cget subcommand for introspecting the configuration of a module instance.


-base base-address

Supplies the modules VME base address. The base-address value must match the base address as set in the module rotary switches.

-id module-id

Defines the module's id. This value appears in the id field of the data returned by the device. The -id value is 8 bits wide and therefore can be an unsigned value between 0 and 255.

This defaults to 0.

-ipl priority-level

Sets the interrupt priority level for interrupt requests from this module. The -ipl value can be between 0 and 7. A value of 0 disables interrupts.

The default value is 0

-vector status-id

Provides the VME status id put on the bus when the module generates an interrupt. The MTDC issues an 8 bit status id. Therefore this value can be between 0 and 255. It defaults to 0

Note that while the MTDC32 produces an 8 bit vector, the VMUSB reads a 16 bit vector. The VME standard is ambiguous about how the top 8 bits are set. The MTDC sets these unused bits to 1. Therefore a -vector 0x80 will produce a vector as seen by the VMUSB of 0xff80.

-irqthreshold word-count

Determines the minimum number of 32 bit words the module must have buffered before it interrupts. When an event has been buffered, if the number of words in the module FIFO is larger than the -irqthreshold value, an interrupt will be requested if enabled.

The FIFO is 32K 32 bit words long so this value can be between 0 and 0x7fff and defaults to 1 which is suitable for single event mode.

-maxtransfers word-count

When the module is in multi-event mode 3, this sets a soft limit on the number of 32 bit words that can be transferred from the module before it issues a BERR. The limit is soft in that complete events are always transferred.

This defaults to 1

-datalen length-spec

Determins how the event is padded for alignment. while the values 8, 16, 32 and 64 are all legal, in pratice since the events are multiples of 32 bit words, only the latter two values are meaningful. If the value 64 is chosen then if necessary 32 bit words containing 0xffff are added to the event data to pad it out to the next 64 bit boundary.

Defaults value for this parameter is 32

-multievent on |off |limited

Enables or disables multi-event mode. If limited is used, the -datalen specification is used as well.

This defaults to off

-skipberr on | off|

If true then at the end of the read rather than asserting BUSERR return data with the top two bits set to 10 indicating an end of buffer.

By default, this is false

-countevents yes | no

If true, then the -maxtransfers value is taken to be the number of events rather than the number of words.

By default this is false.

-marktype timestamp | eventcount | extended-timestamp

Determines what the value in the event correlation field of the data means.

By default, this is timestamp

-joinedbanks yes |no

Only relevant in trigger matching mode when this determines if the gates are ored in to both banks (yes or if they affect individual banks of 16 channels (no). This defaults to true.

Note that in split bank mode, the module acts and supplies data like two independent modules. Thus a single VMUSB trigger may result in two packets of data from this module in trigger matching mode.

-resolution resolution-value

Sets the TDC resolution. This is only relevant in trigger matching modes as the timestamping mode resolution is always 3.9ps. Allowed values are 500ps 250ps 125ps 62.5ps 31.3ps 15.6ps 7.8ps and 3.9ps.

This defaults to 3.9ps

-format standard |fulltime

Determines if the data are time differences from the gate (trigger matching mode) or full timestamps (timestamping mode).

Defaults to standard

-bank0winstart ns, -bank1winstart ns

Determines when the matching window for trigger matching mode starts relative to the gate. -bank1winstart is only relevant with the -joinedbanks is false. This value is a number between 0 and 32767 where the vaslue 16384 means the window starts with the gate, larger values delay the start and smaller values start the matching window prior to the gate.

These both default to 16*1024-16.

-bank0winwidth width, -bank1winwidth width

Determines the width of the trigger matching window. The width value is in nanoseconds and can be 0 through 16383, giving a range of 16 microseconds.

-bank1winwidth is only meaningful if the -joinedbanks is disabled.

These both default to 32.

-bank0triggersource trigger-spec, -bank1triggersource trigger-spec

The actual triggering of the module is quite flexible. These options allow you to specify how the module is triggered. -bank1triggersource is only meaningful if -joinedbanks is off.

The valid values for the trigger-spec are:


The bank is triggered on the Gate 0 input.


The bank is triggered on the Gate 1 input.

Ch0 ... Ch31

The specified channel is the trigger for the bank.


A hit in any channel of Bank 0 is the trigger for the bank.


A hit in any channel of Bank 1 is a trigger for the bank.

The default for -bank0triggerrsource is Tr0, the trigger 0 input. The default for -bank1triggersource is Tr1.

-bank0firsthit boolean, -bank1firsthit boolean

If true, only the first hit from the bank is transmitted. Otherwise all hits in the bank's trigger matching window are transmitted.

This defaults to false allowing multiple hits from both banks of the module.

-edge rising | falling

Determines which signal edge is timed. This defaults to falling.

-tr0terminated boolean, -tr1terminated boolean

If this parameter is true, the ECL Trn input is terminated by the module. If not that input is unterminated.

These parameters defaul to false which allow the trigger inputs to be bussed to other ECL inputs. The input at the end of the bus must be terminated however.

-resetterminated boolean

If true, the ECL reset input is terminated otherwise it is unterminated. This defaults to false

-ecltrig1isoscillator boolean

If true then the ECL trig1 input is treated as an oscillator that is suitable for incrementing the timestamp. Note that you must also set the -timingsource option properly as well to actually ulse this input as the timestamp clock.

Thuis defaults to false.

-trigfromecl boolean

If true, the trigger comes from the ECL inputs, otherwise it comes from the NIM inputs. This is an exclusive setting (see register 0x6068 documentation e.g.)

Defaults to false so that by default the trigger inputs are the NIM inputs.

-nimtrig1isoscillator boolean

The nim TRIG1 input can be used to supply a clock pulse train for the timestamp. See -timingsource which must be set properly as well.

This is false by default.

-busy bothbanks | cbusoutput | abovethreshold

Describes the function of the busy output:


The busy is set when FIFO is full or acquisition is halted (the module cannot accept a busy).


The busy output is used to run a CBUS control bus.


The busy output indicates the FIFO is occupied above the -irqthreshold value.

The default for this paramter is bothbanks.

-pulseron boolean

If true, the test pulser is active. This is false by default.

-pulserpattern bitmask

Sets the pulser pattern, which determines which channels are pulsed. This is 0 by default.

-bank0threshold level, -bank1threshold level

When the modue is jumpered for unipolar inputs, this value determines the threshold used to determine when a signal has happened on the inputs to bankn. If you are doing this read the manual carefully

This defaults to 105 which the manual says is suitable for a NIM input.

-timingsource vme | external

Determines the timing source for the timestamp clock. If vme the 16Mhz backplane clock specified by the VME standard is used. If external, You must have configured one of -ecltrig1isoscillator or -nimtrig1isoscillator to be true in which case the associated input is used as the source for the timestamp clock.

This defaults to vme which is suitable for synchronizing timing across a single VME backplane when used with the madcchain which will use multicast addressing to simultaneously clear the timestamps of all participating modules.

-tsdivisor divisor

Sets the scaledown of the timestamp clock input. This is a 16 bit value and the value 0 means division by 65536.

The default value is 1 which does not scale down the timestamp clock.

-multlow0 0-255

The bank0 number of channels that must be present to define an event (note that if -joinedbanks is true this multiplicity is over both banks).

Defaults to 0

-multhi0 0-255

The largest number of channels that must be present to define an event for bank0 or both banks if -joinedbanks is true.

Defaults to 255

-multlow1 0-255

If banks are not joined the low multiplicity required for an event from bank 1. Defaults to 0

-multhi1 0-255

If banks are not joined, the high multiplicity allowed for an event from bank1. Defaults to 255