## Parameters MADC-32

# Operation Mode
# ############################################################################
# bank_operation
0x6040  0b00        # 0b00 -> banks connected
                    # 0b01 -> operate banks independent
                    # 0b11 -> toggle mode for zero dead time (use with internal GGs)

# adc_resolution
0x6042  3           # 0 -> 2k (800 ns conversion time)
                    # 1 -> 4k (1.6 us)
                    # 2 -> 4k hires (3.2 us)
                    # 3 -> 8k (6.4 us)
                    # 4 -> 8k hires (12.5 us)


# Gate Generators
# ############################################################################
# hold_delay bank0
0x6050  20          # 0 -> 25 ns, 1 -> 150 ns, then multiple of 50 ns
# hold_delay bank1
0x6052  20          # 0 -> 25 ns, 1 -> 150 ns, then multiple of 50 ns

# hold_width bank0
0x6054  50          # multiple of 50 ns
# hold_width bank1
0x6056  50          # multiple of 50 ns

# use_gg
# GG1 can only be activated if banks operate independently (0x6040 != 0)!
0x6058  0b00        # 0b01 -> use GG0
                    # 0b10 -> use GG1

# I/O
# ############################################################################
# input_range
0x6060  0           # 0 -> 4 V, 1 -> 10 V, 2 -> 8 V

# ECL_term
0x6062  0b000       # switch ECL terminators on (1 -> on)
                    # low bit for "gate0", high bit for "fast clear"
                    # Switch terminators off when inputs are not used. Then inputs
                    # will be set to a well defined state by internal weak resistors.

# ECL_gate1_osc (ECL2)
0x6064  0           # 0 -> gate1 input
                    # 1 -> oscillator input (also set CTRA.ts_sources (0x6096)!)

# ECL_fc_res (ECL1)
0x6066  0           # 0 -> fast clear input
                    # 1 -> reset time stamp oscillator input

# ECL_busy (ECL 0)
0x6068  0           # 0 -> as busy output
                    # 1 -> reserved

# NIM_gat1_osc (NIM 2)
0x606A  0           # 0 -> gate1 input
                    # 1 -> oscillator input (also set CTRA.ts_sources (0x6096)!)

# NIM_fc_reset (NIM 1)
0x606C  0           # 0 -> fast clear input
                    # 1 -> reset time stamp oscillator, hold at value 0

# NIM_busy (NIM 0)
0x606E  0           # 0 -> as busy (in independent bank operation or toggle mode:
                    #               active when both banks are busy)
                    # 1 -> as gate0 output
                    # 2 -> as gate1 output
                    # 3 -> as CBus otuput (Needs up to 100 us. Reading the register
                    #                      returns the correct status.)
                    # 4 -> buffer full
                    # 8 -> data in buffer above threshold 0x6018
                    # 9 -> events in buffer above threshold 0x601E (since firmware FW0220)

# Internal Test Pulser
# ############################################################################
# pulser_status
0x6070  0b000       # 0b000 -> off
                    # 0b100 -> amplitude = 0
                    # 0b101 -> low amplitude (7%)
                    # 0b110 -> high amplitude (75%)
                    # 0b111 -> amplitude cycling: 0 -> low -> high -> 0

# Timestamp/Event Counters: CTRA, CTRB
# ############################################################################
# ts_sources
0x6096  0b00        # bit 0: frequency source (0 -> VME, 1 -> external)
                    # bit 1: external reset enable

# ts_divisor (16 bit value)
0x6098  1           # timestamp = time / ts_divisor
                    # 0 means division by 65536

# stop_ctr
#0x60AE  0b00       # bit 0: stop CTRB (time_0, time_1, time_2)
                    # bit 1: stop CTRA (ts_counter_lo, ts_counter_hi)
                    # with 0 -> run, 1 -> stop counter

# Thresholds
# ############################################################################
# Channel thresholds are relative to the current data output width (2k, 4k or
# 8k), see 0x6042 and 0x6046

# ignore_thresholds
0x604C  0           # If set the threshold settings starting a 0x4000 are ignored (0 is assumed).

# Individual channel thresholds. 12 bit values, 0 means the threshold is not used.
# 0x1FFF switches the channel off.
0x4000  0           # channel  0
0x4002  0           # channel  1
0x4004  0           # channel  2
0x4006  0           # channel  3
0x4008  0           # channel  4
0x400A  0           # channel  5
0x400C  0           # channel  6
0x400E  0           # channel  7
0x4010  0           # channel  8
0x4012  0           # channel  9
0x4014  0           # channel 10
0x4016  0           # channel 11
0x4018  0           # channel 12
0x401A  0           # channel 13
0x401C  0           # channel 14
0x401E  0           # channel 15
0x4020  0           # channel 16
0x4022  0           # channel 17
0x4024  0           # channel 18
0x4026  0           # channel 19
0x4028  0           # channel 20
0x402A  0           # channel 21
0x402C  0           # channel 22
0x402E  0           # channel 23
0x4030  0           # channel 24
0x4032  0           # channel 25
0x4034  0           # channel 26
0x4036  0           # channel 27
0x4038  0           # channel 28
0x403A  0           # channel 29
0x403C  0           # channel 30
0x403E  0           # channel 31

#### Expert settings, usually leave at default ##############
# adc_override
#0x6046  3          # If set overrides the channel output width but not the conversion time.
                    # Values are the same as for adc_resolution.
