--- /dev/null
+0 2340
+1 2340
+2 2340
+3 2340
+4 1609
+5 1609
+6 1609
+7 2404
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+# first disable test_trigger_ mode to allow reading
+REG20=$(trb_i2c r 0x8900 0x08 0x20 | awk '{print $2}')
+trb_i2c w 0x8900 0x08 0x20 0x00
+
+# Channel Masks
+trb_i2c w 0x8900 0x08 0x00 0xff
+trb_i2c w 0x8900 0x08 0x01 0xff
+trb_i2c w 0x8900 0x08 0x02 0xff
+trb_i2c w 0x8900 0x08 0x03 0xff
+trb_i2c w 0x8900 0x08 0x04 0xff
+trb_i2c w 0x8900 0x08 0x05 0xff
+trb_i2c w 0x8900 0x08 0x06 0xff
+trb_i2c w 0x8900 0x08 0x07 0xff
+trb_i2c w 0x8900 0x08 0x08 0xff
+trb_i2c w 0x8900 0x08 0x09 0xff
+trb_i2c w 0x8900 0x08 0x0a 0xff
+trb_i2c w 0x8900 0x08 0x0b 0xff
+trb_i2c w 0x8900 0x08 0x0c 0xff
+trb_i2c w 0x8900 0x08 0x0d 0xff
+trb_i2c w 0x8900 0x08 0x0e 0xff
+trb_i2c w 0x8900 0x08 0x0f 0xff
+
+# Restore Register 20
+trb_i2c w 0x8900 0x08 0x20 $REG20
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+if [ -z "$1" ]
+then
+ echo "Usage: $0 ChannelID"
+ exit 0;
+fi
+
+# first disable test_trigger_ mode to allow reading
+REG20=$(trb_i2c r 0x8900 0x08 0x20 | awk '{print $2}')
+trb_i2c w 0x8900 0x08 0x20 0x00
+
+REGISTER=$(($1/8))
+MASK=$((2**($1-8*$REGISTER)))
+
+echo "Register: $REGISTER Mask: $MASK"
+
+CURRENT=$(trb_i2c r 0x8900 0x08 $REGISTER | awk '{print $2}' | base)
+NEW=$(($CURRENT|$MASK))
+
+echo "$CURRENT -> $NEW"
+trb_i2c w 0x8900 0x08 $REGISTER $NEW
+
+# Restore Register 20
+trb_i2c w 0x8900 0x08 0x20 $REG20
--- /dev/null
+#!/bin/sh
+
+#disable Testtrigger
+trb_i2c w 0x8900 0x08 0x20 0x00
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+# first disable test_trigger_mode to allow reading
+#REG20=$(trb_i2c r 0x8900 0x08 0x20 | awk '{print $2}')
+#trb_i2c w 0x8900 0x08 0x20 0x00
+
+echo " 01234567"
+#echo " --------"
+for REG in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+do
+
+VALUE=$(trb_i2c r 0x8900 0x08 $REG | awk '{print $2}' | base)
+CHANNEL=$((8*$REG))
+printf "%03d: " $CHANNEL
+
+for i in 0 1 2 3 4 5 6 7
+do
+ BIT=$(($VALUE>>$i&1))
+ if [ $BIT -eq 0 ]
+ then
+ echo -n "*"
+ else
+ echo -n "_"
+ fi
+done
+echo
+done
+
+# Restore Register 20
+#trb_i2c w 0x8900 0x08 0x20 $REG20
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+# first disable test_trigger_ mode to allow reading
+REG20=$(trb_i2c r 0x8900 0x08 0x20 | awk '{print $2}')
+trb_i2c w 0x8900 0x08 0x20 0x00
+
+# Channel Masks
+trb_i2c w 0x8900 0x08 0x00 0x00
+trb_i2c w 0x8900 0x08 0x01 0x00
+trb_i2c w 0x8900 0x08 0x02 0x00
+trb_i2c w 0x8900 0x08 0x03 0x00
+trb_i2c w 0x8900 0x08 0x04 0x00
+trb_i2c w 0x8900 0x08 0x05 0x00
+trb_i2c w 0x8900 0x08 0x06 0x00
+trb_i2c w 0x8900 0x08 0x07 0x00
+trb_i2c w 0x8900 0x08 0x08 0x00
+trb_i2c w 0x8900 0x08 0x09 0x00
+trb_i2c w 0x8900 0x08 0x0a 0x00
+trb_i2c w 0x8900 0x08 0x0b 0x00
+trb_i2c w 0x8900 0x08 0x0c 0x00
+trb_i2c w 0x8900 0x08 0x0d 0x00
+trb_i2c w 0x8900 0x08 0x0e 0x00
+trb_i2c w 0x8900 0x08 0x0f 0x00
+
+# Restore Register 20
+trb_i2c w 0x8900 0x08 0x20 $REG20
+
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+if [ -z "$1" ]
+then
+ echo "Usage: $0 ChannelID"
+ exit 0;
+fi
+
+# first disable test_trigger_ mode to allow reading
+REG20=$(trb_i2c r 0x8900 0x08 0x20 | awk '{print $2}')
+trb_i2c w 0x8900 0x08 0x20 0x00
+
+REGISTER=$(($1/8))
+MASK=$((2**($1-8*$REGISTER)))
+
+echo "Register: $REGISTER Mask: $MASK"
+
+CURRENT=$(trb_i2c r 0x8900 0x08 $REGISTER | awk '{print $2}' | base)
+NEW=$(($CURRENT^$MASK))
+
+echo "$CURRENT -> $NEW"
+trb_i2c w 0x8900 0x08 $REGISTER $NEW
+
+# Restore Register 20
+trb_i2c w 0x8900 0x08 0x20 $REG20
+
--- /dev/null
+#!/bin/sh
+
+#enable Testmode
+
+trb_i2c w 0x8900 0x08 0x21 0x0d # bit 3: must be 1,
+ # bit 2: nxyter-polarity 0: negative
+ # bit 0-1: test puls channels:
+ # 0: 0,4, 1:1,5, 2:2,6, 3:3,7
+
+trb_i2c w 0x8900 0x08 0x20 0x01 # bit3: enable test_trigger
+ # bit2: test-polarity 0: negative
+ # bit1: test-pulse synchronise
+ # bit0: enable test pulse
--- /dev/null
+#!/bin/sh
+
+#enable Testmode
+
+trb_i2c w 0x8900 0x08 0x21 0x0c # bit 3: must be 1,
+ # bit 2: nxyter-polarity 0: negative
+ # bit 0-1: test puls channels:
+ # 0: 0,4, 1:1,5, 2:2,6, 3:3,7
+
+trb_i2c w 0x8900 0x08 0x20 0x08 # bit3: enable test_trigger
+ # bit2: test-polarity 0: negative
+ # bit1: test-pulse synchronise
+ # bit0: enable test pulse
+
+trbcmd w 0x8900 0x8161 1 # Enable Testpulse Signal
--- /dev/null
+# Time from Trogger pulse to first valid timestamp: 400ns
+ --> maximum correlation window
--- /dev/null
+#------------------------------------------
+# Value I2C RegisterAddress
+#------------------------------------------
+0x00000000 # 0 Channel Masks BEGIN
+0x00000000 # 1
+0x00000000 # 2
+0x00000000 # 3
+0x00000000 # 4
+0x00000000 # 5
+0x00000000 # 6
+0x00000000 # 7
+0x00000000 # 8
+0x00000000 # 9
+0x00000000 # 10
+0x00000000 # 11
+0x00000000 # 12
+0x00000000 # 13
+0x00000000 # 14
+0x00000000 # 15 Channel Masks END
+0x000000a0 # 16
+0x000000ff # 17
+0x0000003c # 18 Common Threshold, default 0x80
+0x0000001e # 19
+0x0000005f # 20
+0x00000057 # 21
+0x00000064 # 22
+0x00000089 # 23
+0x000000ff # 24 Testpulse Strength, default 0x80
+0x00000045 # 25
+0x0000000f # 26
+0x00000036 # 27
+0x0000005c # 28
+0x00000045 # 29
+0x000000be # 30
+0x000000be # 31
+0x00000004 # 32 TestTrigger setup etc. , default 0x00
+0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode)
+0x000000be # 34
+0x000000be # 35
+0x000000be # 36
+0x000000be # 37
+0x00000000 # 38
+0x00000000 # 39
+0x000000be # 40
+0x000000be # 41
+0x000000be # 42 Channel shutdown register, FIFO, do not touch
+0x00000000 # 43
+0x00000000 # 44
+0x000000ff # 45
--- /dev/null
+#------------------------------------------
+# Value I2C RegisterAddress
+#------------------------------------------
+0x000000aa # 0 Channel Masks BEGIN
+0x00000000 # 1
+0x00000000 # 2
+0x00000000 # 3
+0x00000000 # 4
+0x00000000 # 5
+0x00000000 # 6
+0x00000000 # 7
+0x00000000 # 8
+0x00000000 # 9
+0x00000000 # 10
+0x00000000 # 11
+0x00000000 # 12
+0x00000000 # 13
+0x00000000 # 14
+0x00000000 # 15 Channel Masks END
+0x00000080 # 16
+0x00000080 # 17
+0x00000030 # 18 Common Threshold, default 0x80
+0x00000080 # 19
+0x00000080 # 20
+0x00000080 # 21
+0x00000080 # 22
+0x00000080 # 23
+0x00000080 # 24 Testpulse Strength, default 0x80
+0x00000080 # 25
+0x00000080 # 26
+0x00000080 # 27
+0x00000080 # 28
+0x00000080 # 29
+0x000000be # 30
+0x000000be # 31
+0x00000000 # 32 TestTrigger setup etc. , default 0x00
+0x00000008 # 33 clock input 256A, set bit #3, default 0x08 (normal mode)
+0x000000be # 34
+0x000000be # 35
+0x000000be # 36
+0x000000be # 37
+0x00000000 # 38
+0x00000000 # 39
+0x000000be # 40
+0x000000be # 41
+0x000000be # 42 Channel shutdown register, FIFO, do not touch
+0x00000000 # 43
+0x00000000 # 44
+0x000000bb # 45
--- /dev/null
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
--- /dev/null
+#!/bin/sh
+
+i=0
+while [ $i -lt 129 ]
+do
+ VALUE=$(trb_i2c r 0x8900 0x08 42 | awk '{print $2}')
+ echo "$i : $VALUE"
+ trb_i2c w 0x8900 0x08 42 $VALUE
+ i=$((i+1))
+done
+
--- /dev/null
+/home/rich/TRB/nXyter/trb3/nxyter/source/registers.txt
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/bin:${PATH}
+
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/bin:${PATH}
+
+# i2c_sm_reset
+trbcmd w 0x8900 0x8100 0x01
+# i2c_reg_reset_start
+trbcmd w 0x8900 0x8101 0x01
+
+# Write nxsetup.dat to memory and transfer to nx-i2c-registers
+trbcmd wm 0x8900 0x8200 0 nxsetup.dat
+trbcmd w 0x8900 0x8241 1
+
+#enable Testmode
+#trb_i2c w 0x8900 0x08 0x20 0x08 # bit0: enable test pulse
+ # bit2: test-polarity 0: negativ 1:positiv
+ # bit 3: enable test_trigger
+#trb_i2c w 0x8900 0x08 0x21 0x0d # bit3: must be 1, bit 2: nxyter-polarity,
+ # bit 0-1: test puls channels: 0: 0,4,
+ # 1:1,5, 2:2,6, 3:3,7
+
+# Threshold setting
+#trb_i2c w 0x8900 0x08 18 0x80
+
+# Setup Trigger Generator
+trbcmd w 0x8900 0x8141 200 # 500 * 10ns = 5mus Period
+trbcmd w 0x8900 0x8142 1 # one Trigger per cycle
+trbcmd w 0x8900 0x8143 16 # 200ns trigger length, disable it
+trbcmd w 0x8900 0x8144 0 # reset before trigger
+
+
+# nx_ts_reset_start
+trbcmd w 0x8900 0x8102 0x01
+
+# reset counters, flush FIFO
+echo "clear data fifo"
+trbcmd rm 0x8900 0x8600 4000 1 > /dev/null
+
+# Set readout Mode
+trbcmd w 0x8900 0x8180 0x00 # normal mode
+trbcmd w 0x8900 0x8182 100 # window width = 100 * 4ns
+
+# Decoder Settings
+trbcmd w 0x8900 0x8120 0 # reset all counters
+
+# Enable nxyter
+trbcmd w 0x8900 0x8103 0
--- /dev/null
+#!/bin/sh
+
+trbcmd w 0x8900 0x8140 0x01
+
+#trbcmd rm 0x8900 0x8600 2000 1 | grep -v '^H:' | head -n -2 | awk '{printf "%s %s\n", $1, $2}'
+trbcmd rm 0x8900 0x8600 2000 1
--- /dev/null
+#!/bin/sh
+
+export PATH=/home/rich/TRB/trbsoft/trbnettools/binlocal:${PATH}
+
+./setup.sh
+./disable_all.sh
+./enable_channel.sh 0
+./enable_channel.sh 1
+./enable_channel.sh 2
+./enable_channel.sh 3
+
+trbcmd w 0x8900 0x8180 4
+
+./enable_testtrigger.sh
+./display_channels.sh
--- /dev/null
+trbcmd clearbit 0x8111 0xc0 0xe ##trigger off for hub channel 1-3
+trbcmd clearbit 0x8111 0xc1 0xe
+trbcmd clearbit 0x8111 0xc3 0xe
+
+## never turn of bit 1 in hub!
--- /dev/null
+#!/bin/sh
+
+i=0
+while [ $i -lt 129 ]
+do
+ VALUE=$(trb_i2c r 0x8900 0x08 42 | awk '{print $2}')
+ echo "$i : $VALUE"
+ trb_i2c w 0x8900 0x08 42 0x20
+ #trb_i2c w 0x8900 0x08 42 0x00
+ i=$((i+1))
+done
+