madc create name ?option value...?
madc config name option value?..?
madc cget name ?option?
The Mesytec MADC32 is a 32 channel peak sensing ADC. It support either common gate mode or a split gate mode where banks of 16 chanels are independentyl gated. It can place a timestamp in the data obtained from either an external clock source or the 16MHz VME backplane clock.
Modules can be individually read out or grouped into a block chain readout using the madcchain command. Since this module has a lot of features you may want to refer to the manual at https://wikihost.frib.msu.edu/S800Doc/lib/exe/fetch.php?media=wiki:madc-32.pdf
-base vme-addresssThe base address of the module, programmed in its rotary switches. If not configured, this defaults to 0 so, in general this option better be configured.
-id integer-0-255The id of the module included in the data from the module to allow you to know which chunk of data comes from which modules. See the manual for where this is in the data. If not configured, this defaults to 0. Each module should have a unique ID.
-ipl levelIf the module is used to trigger a stack via interrupt, this is the priority level of the interrupt. If not configured, this defaults to 0 which disables module interrupts. At the FRIB, this is the normal usage.
-vector status-id
If interrupts are enabled, this configures the status id (vector) that
the module will interrupt with. If not configured, this is 0 and
that's normal for FRIB where -ipl is generally zero,
disabling module interrupts.
-timestamp on | off
If this is turned on, a timestamp is included in the module data. If off,
an event sequence number will be used instead. See -timingsource
to set the source of the clock that is used to provide the timestamp. Note that
if the modules are incorporated into a madcchain the
timestamp counters for all modules in the crate are synchronously cleared using broadcast
addresssing. If not configured, this will default to off providing a sequence number.
-gatemode common | separate
Determines how the module is gated. If common, all 32 channels have a common gate and either
Gate0 or Gate1 will gate the module. If separate, then Gate0 gates the first 16 channels and Gate1
the second. Note that in this mode, for each event, the module will return two data packets, as if
it were two 16 channel modules with the same -id.
-gategenerator on | off
If on, the Gate0 and Gate1 inputs are routed through gate and delay generators.
This can be used to align gates with the signals in the channels. See
-holddelays and -holdwidths for the parameters of
these gate and delay generators.
If not configured, this is off, by default. Gate generators can be monitored on the
module front panel BUSY output by programming it for gate0 or gate1.
-holddelays two-element-list
Programs the delays for the two gate and delay generators enabled by
-gategenerator. These values must be in the range 0 - 255. A value of
0 represents 50 ns and each step is 50ns, thus a value of 10 is 550ns of delay. The
two list elements allow each gate generator to be individually programmed. Note that
if not configured, these default to 15.
-holdwidths two-element-listPrograms the widths of the two gates and delay generators. These are values from 0 - 255. The widths increase in units of 50ns. The manual is not clear but I believe that, a value of 1 represents 50ns. Note that to trigger digitization requires a minimum gate width of 80ns.
-inputrange 4v | 8v | 10vSets the input range of the module. If not programmed, this defaults to 4v.
-ecltermination on | offIf On, the ECL command bus terminators are enabled. If you bus the ECl command bus, only the last module should turn this on. If not configured, this defaults to on.
-ecltiming on | off
When on, the ECL bus Gate1 input can be used as the clock source for
the timestamp. This is off if not configured. The timing source must be
at most 75MHz. See, however -timingsource. Note that only
-ecltiming or -nimtiming should be on, not both.
-nimtiming on | off
If on, the Gate1 input can be used as the clock source for the timestamp.
Only -ecltiming or -nimtiming should be enabled
but not both. See -timingsource. If not configured, this
defaults to off.
-timingsource vme | external
If timestamps are enabled, determines the sourcde of the clock. vme, the default, if not
configured, uses the VME backplane clock (16MHz). If external, the either
-ecltiming or -nimtiming must be on but not both,
in that case, the clock comes from the enabled timing.
-timingdivisor integer-0-0xffffDetermines the clock divisor for the timestamp clock. Note that a value of zero is a divisor of 65536. If not configured, this defaults to 15. Note that maybe 1 is a better value?
-thresholds list-of-32-integers-0-0xfffProvides the list of thresholds for each channel for zero suppresssion. If the conversion of a channel is below its threshold, it is not included in the data set. Zero suppression is always enabled. If not configured, the default is 32 zeroes which, effectively, disables zero suppression by ensuring all conversions are above threshold due to ADC pedestals.
-pulser on | offIF on the test pulser is enabled at low amplitude (7% of full scale). This pulses all channels. If not configured this defaults to off.
-multievent on | off
To be used in interrupt mode. See -irqthresshold If not
configured, this defaults to off. In multievent mode, more than one event can be
buffered and the read will read all buffered events when the list is triggered.
-irqthreshold wordsIf run in interrupt mode, when the modle has buffered at least this number of 32 bit words it generates an interrupt. This can be no more than 8120. If not programmed this defaults to 0 interrupting as soon as data is buffered.
-resolution 2k | 4k | 4khires | 8k | 8khiresPrograms the desired resolution. Note that in the manual, the table labeled "Output formats, resolutions, conversion time" describes these resolutions. If not programmed, this defaults to 8k.
-nimbusy busy | gate0 | gate1| cbusWhile the module has a NIM output labeled "Busy", this output can be programmed for a variety of functions. If busy (the default if not configured), this output will, in fact, be the busy state of the module. IF gate0 or gate1, the output will monitor the output of one of the gate generators, while if cbus is selected, the output can be used to control external Mesytec C-Bus modules. While we do have GUIs to do that, it is not recommended that you do this as the specifications for how to control modules change in ways that are difficult ot predict and adapt. We recommend, instead, using the mesycontrol application and an MRCC controller.