From 7c347badd52e9748fcbd048e427b4513253cbd58 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Thu, 12 Jun 2025 11:35:39 +0200 Subject: [PATCH] added zero trimbits to matterhorn config --- .../xilinx_ctbDetectorServer/CMakeLists.txt | 1 + .../xilinx_ctbDetectorServer/Makefile | 1 + .../chip_config_xilinx.txt | 13 +++ .../put_trimbits_zero.pyat | 82 +++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 slsDetectorServers/xilinx_ctbDetectorServer/put_trimbits_zero.pyat diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt index db081528a..1f689ab89 100644 --- a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt @@ -44,5 +44,6 @@ install(TARGETS xilinx_ctbDetectorServer_virtual configure_file(chip_config_xilinx.txt ${CMAKE_BINARY_DIR}/bin/chip_config_xilinx.txt COPYONLY) configure_file(reset_chip_xilinx.txt ${CMAKE_BINARY_DIR}/bin/reset_chip_xilinx.txt COPYONLY) configure_file(enable_clock_pattern.pyat ${CMAKE_BINARY_DIR}/bin/enable_clock_pattern.pyat COPYONLY) +configure_file(put_trimbits_zero.pyat ${CMAKE_BINARY_DIR}/bin/put_trimbits_zero.pyat COPYONLY) configure_file(readout_pattern.pyat ${CMAKE_BINARY_DIR}/bin/readout_pattern.pyat COPYONLY) diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/Makefile b/slsDetectorServers/xilinx_ctbDetectorServer/Makefile index 59cf0fe37..d64b91fd5 100755 --- a/slsDetectorServers/xilinx_ctbDetectorServer/Makefile +++ b/slsDetectorServers/xilinx_ctbDetectorServer/Makefile @@ -51,6 +51,7 @@ $(PROGS): $(OBJS) cp chip_config_xilinx.txt $(DESTDIR) cp reset_chip_xilinx.txt $(DESTDIR) cp enable_clock_pattern.pyat $(DESTDIR) + cp put_trimbits_zero.pyat $(DESTDIR) cp readout_pattern.pyat $(DESTDIR) rm $(main_src)*.o $(md5_dir)*.o clean: diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/chip_config_xilinx.txt b/slsDetectorServers/xilinx_ctbDetectorServer/chip_config_xilinx.txt index 3f48ea84c..e4334f12c 100644 --- a/slsDetectorServers/xilinx_ctbDetectorServer/chip_config_xilinx.txt +++ b/slsDetectorServers/xilinx_ctbDetectorServer/chip_config_xilinx.txt @@ -2,12 +2,25 @@ reg 0xC00C 0x00000041 reg 0xC010 0x01200004 +# turn on external CLKSEL for trimbit upload +setbit 0xC00C 17 + # configure Matterhorn SPI setbit 0xC014 0 # wait till config is done pollbit 0xC014 3 0 +# set trimbits to 0 +pattern put_trimbits_zero.pyat +setbit 0xB030 0 +clearbit 0xB030 0 +sleep 1 +pollbit 0xB004 0 0 +clearbit 0xC00C 17 +setbit 0xC014 0 +pollbit 0xC014 3 0 + # reset transceiver reg 0xC120 0x0 reg 0xC120 0x1 diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/put_trimbits_zero.pyat b/slsDetectorServers/xilinx_ctbDetectorServer/put_trimbits_zero.pyat new file mode 100644 index 000000000..49d47230a --- /dev/null +++ b/slsDetectorServers/xilinx_ctbDetectorServer/put_trimbits_zero.pyat @@ -0,0 +1,82 @@ +patword 0x0000 0x0000000000000000 +patword 0x0001 0x0000000000000000 +patword 0x0002 0x0000000000000000 +patword 0x0003 0x0000000000000000 +patword 0x0004 0x0000000000000000 +patword 0x0005 0x0000000000000000 +patword 0x0006 0x0000000000000000 +patword 0x0007 0x0000000000000000 +patword 0x0008 0x0000000000000000 +patword 0x0009 0x0000000000000000 +patword 0x000a 0x0000000000000000 +patword 0x000b 0x0000000000000000 +patword 0x000c 0x0000000000000000 +patword 0x000d 0x0000000000001000 +patword 0x000e 0x0000000000001000 +patword 0x000f 0x0000000000001000 +patword 0x0010 0x0000000000001000 +patword 0x0011 0x0000000000001000 +patword 0x0012 0x0000000000000000 +patword 0x0013 0x0000000000000000 +patword 0x0014 0x0000000000000000 +patword 0x0015 0x0000000000000000 +patword 0x0016 0x0000000000000000 +patword 0x0017 0x0000000000000400 +patword 0x0018 0x0000000000000400 +patword 0x0019 0x0000000000000400 +patword 0x001a 0x0000000000000400 +patword 0x001b 0x0000000001000400 +patword 0x001c 0x0000000001000400 +patword 0x001d 0x0000000001000400 +patword 0x001e 0x0000000001000400 +patword 0x001f 0x0000000000000400 +patword 0x0020 0x0000000000000400 +patword 0x0021 0x0000000000000400 +patword 0x0022 0x0000000000000400 +patword 0x0023 0x0000000000001400 +patword 0x0024 0x0000000000001400 +patword 0x0025 0x0000000000001400 +patword 0x0026 0x0000000000001400 +patword 0x0027 0x0000000001001400 +patword 0x0028 0x0000000001001400 +patword 0x0029 0x0000000001001400 +patword 0x002a 0x0000000001001400 +patword 0x002b 0x0000000000001400 +patword 0x002c 0x0000000000001400 +patword 0x002d 0x0000000000001400 +patword 0x002e 0x0000000000001400 +patword 0x002f 0x0000000000000400 +patword 0x0030 0x0000000000000400 +patword 0x0031 0x0000000000000400 +patword 0x0032 0x0000000000000400 +patword 0x0033 0x0000000000000400 +patword 0x0034 0x0000000000000400 +patword 0x0035 0x0000000000000400 +patword 0x0036 0x0000000000000400 +patword 0x0037 0x0000000000000000 +patioctrl 0x0000000001b3ffff +patlimits 0x0000 0x0037 +patloop 0 0x0018 0x0036 +patnloop 0 192 +patloop 1 0x0400 0x0400 +patnloop 1 0 +patloop 2 0x0400 0x0400 +patnloop 2 0 +patloop 3 0x0400 0x0400 +patnloop 3 0 +patloop 4 0x0400 0x0400 +patnloop 4 0 +patloop 5 0x0400 0x0400 +patnloop 5 0 +patwait 0 0x0400 +patwaittime 0 0 +patwait 1 0x0400 +patwaittime 1 0 +patwait 2 0x0400 +patwaittime 2 0 +patwait 3 0x0400 +patwaittime 3 0 +patwait 4 0x0400 +patwaittime 4 0 +patwait 5 0x0400 +patwaittime 5 0