#trbcmd w 0x8000 0xa140 0x000f4240 # pulser freq 100 Hz
trbcmd w 0x8000 0xa140 0x05f5e0ff # pulser freq 1 Hz
-trbcmd setbit 0x8000 0xa101 0x2 # turn on pulser
+trbcmd w 0x8000 0xa141 0x05f5e100 #periodic pulser 1 at 1 Hz for 0xE trigger type
+
+trbcmd loadbit 0x8000 0xa148 0x0f00 0x0e00 # setting trigger type E for second pulser
+trbcmd setbit 0x8000 0xa101 0x6 # turn on periodic pulser 1 and 0
trbcmd loadbit 0x8000 0xa13d 0x7f 0xa # setting multiplexer input
trbcmd loadbit 0x8000 0xa13e 0x7f 0xb # setting multiplexer input
-
trbcmd loadbit 0x8000 0xa129 0x100 0x100 # setting multiplexer input invert
-trbcmd w 0x8000 0xc801 0x000f000f
+
+
+trbcmd w 0x8000 0xc801 0x000f000f #for TDC inside CTS (not used): set trigger window
# Set readout Mode
trbcmd w $board 0x8400 0x00 # 0: normal mode 4: no TS Window mode
trbcmd w $board 0x8401 0 # window offset 200ns
-trbcmd w $board 0x8402 250 # window width 800ns
+#trbcmd w $board 0x8402 250 # window width 800ns
+trbcmd w $board 0x8402 400 # window width 1600ns
trbcmd w $board 0x8403 125 # CTS-Delay 400ns
trbcmd w $board 0x8140 100 # test pulse length 400 ns
+# TS sync
+trbcmd w $board 0x850d 8 # reset all counters
+
# Decoder Settings
trbcmd w $board 0x8120 0 # reset all counters