Cleaning alot of redundant setup. This version commented with explanations.

This commit is contained in:
redford_s
2018-03-16 14:10:58 +01:00
parent 1a1b514fd4
commit 3653bb2d12

View File

@ -4,78 +4,88 @@
# prerequisites:
# - the hostname is set
# - source /afs/psi.ch/project/sls_det_software/slsDetectorsPackage/bin/setup_SL6_64bit.sh
# - PATH=$PATH:/afs/psi.ch/project/sls_det_software/slsDetectorsPackage/bin/
# - export PATH=/afs/psi.ch/project/sls_det_software/latest_slsDetectorPackage/build/bin:$PATH
# - export LD_LIBRARY_PATH=/afs/psi.ch/project/sls_det_software/latest_slsDetectorPackage/build/bin:$LD_LIBRARY_PATH
# - detector is on
# prepare detector as in v0_5/prepare_mpc2012.sh
# set dacs as in setDacs_Fmodule_LCLS.sh
sls_detector_put dac:5 1000
sls_detector_put dac:0 1220
sls_detector_put dac:4 750
sls_detector_put dac:6 480
sls_detector_put dac:7 420
sls_detector_put dac:3 1450
sls_detector_put dac:2 1053
sls_detector_put dac:1 3000
#sls_detector_put dac:5 1000 # same by default
#sls_detector_put dac:0 1220 # same by default
#sls_detector_put dac:4 750 # same by default
#sls_detector_put dac:6 480 # same by default
#sls_detector_put dac:7 420 # same by default
#sls_detector_put dac:3 1450 # same by default
#sls_detector_put dac:2 1053 # same by default
#sls_detector_put dac:1 3000 # same by default
# power on the chips
sls_detector_put reg 0x5e 0x1
#sls_detector_put reg 0x5e 0x1 # 0x0 by default (off) must be turned on, can use command powerchip
sls_detector_put powerchip 1
# reset_adc
sls_detector_put adcreg 0x08 0x3;sls_detector_put adcreg 0x08 0x0; sls_detector_put adcreg 0x14 0x40;
sls_detector_put adcreg 0x4 0xf
sls_detector_put adcreg 0x5 0x3f
# reset_adc - already done by the server
#sls_detector_put adcreg 0x08 0x3;sls_detector_put adcreg 0x08 0x0; sls_detector_put adcreg 0x14 0x40;
#sls_detector_put adcreg 0x4 0xf
#sls_detector_put adcreg 0x5 0x3f
# vrefs
sls_detector_put adcreg 0x18 0x2
#sls_detector_put adcreg 0x18 0x2
# set ADCINVERSionreg (by trial and error)
sls_detector_put reg 0x43 0x453b2a9c
sls_detector_put reg 0x43 0x453b2a9c # 0x0 by default. Carlos says keep it, but not having any effect
# set adc_pipeline
sls_detector_put reg 0x42 0x20
sls_detector_put reg 0x59 0x1000
sls_detector_put reg 0x4d 0x00100000
sleep 1
#sls_detector_put reg 0x42 0x20 # same by default
#sls_detector_put reg 0x59 0x1000 # same by default
#sls_detector_put reg 0x4d 0x00100000 # same by default
#sleep 1
# set adc_clock_phase in unit of 1/(52) clock period (by trial and error)
sls_detector_put adcphase 72
sls_detector_put adcphase 72 # 65 by default
# storage cell f
sls_detector_put reg 0x5d 0xf00
#sls_detector_put reg 0x5d 0xf00 # same by default
# reset mem machine fifos fifos
sls_detector_put reg 0x4f 0x4000
sls_detector_put reg 0x4f 0x0
# reset mem machine fifos fifos - not necessary
#sls_detector_put reg 0x4f 0x4000
#sls_detector_put reg 0x4f 0x0
# reset run control
sls_detector_put reg 0x4f 0x0400;sls_detector_put reg 0x4f 0x0;
# reset run control - not necessary
#sls_detector_put reg 0x4f 0x0400;sls_detector_put reg 0x4f 0x0;
# delay
sls_detector_put delay 0
#sls_detector_put delay 0 # same by default
# cycles
sls_detector_put cycles 1
#sls_detector_put cycles 1 # same by default
# frames
sls_detector_put frames 640
sls_detector_put frames 640 # 100000000 by default
# period
sls_detector_put period 0.005
sls_detector_put period 0.005 # 0.002000000 by default
# exposure time
sls_detector_put exptime 0.000010
sls_detector_put exptime 0.000010 # same by default - prefer to keep it explicit
# high voltage
sls_detector_put vhighvoltage 200
sls_detector_put vhighvoltage 200 # 0 by default
# configure for receiver on mpc2012
sls_detector_put 0:rx_udpport 32410
sls_detector_put 0:rx_udpip 10.1.3.105
sls_detector_put 0:rx_udpmac 3C:FD:FE:A2:14:D9
sls_detector_put 0:detectorip 10.1.3.9
sls_detector_put 0:detectormac 00:ab:be:cc:dd:e2
sls_detector_put 0:configuremac 0
sls_detector_put rx_udpport 32410
sls_detector_put rx_udpip 10.1.3.105
sls_detector_put rx_udpmac 3C:FD:FE:A2:14:D9
sls_detector_put detectorip 10.1.3.9
sls_detector_put detectormac 00:ab:be:cc:dd:e2
sls_detector_put configuremac 0
sls_detector_put reg 0x5c 0 # what is this? does it have an effect?
#sls_detector_put reg 0x5c 0 # 0x1a4 by default
# feature to prevent gain switching at the end of long integration times if enabled
# default value means disabled. will switch even at the end of long integration times.
# the 1a4 at the end is the reset threshold (=420=dac7)
# 0 also means disabled. but the reset threshold isn't set
# to enable it:
# sls_detector_put setbit 0x5c 31
# or
# sls_detector_put reg 0x5c 0x800001a4
echo "The receiver should be waiting for data"
@ -237,4 +247,4 @@ sls_detector_put exptime 0.000010
sls_detector_put period 0.002
sls_detector_put frames 1000000
sls_detector_put clearbit 0x5d 16
echo "Script finished"
echo "Script finished"