Browse Source

Fixed flipped register banks for Bunch Shifts

Timo Dritschler 3 years ago
parent
commit
2135e66532
1 changed files with 14 additions and 3 deletions
  1. 14 3
      KCG/base/backend/board/board_config.py

+ 14 - 3
KCG/base/backend/board/board_config.py

@@ -589,9 +589,17 @@ class BoardConfiguration(QtGui.QWidget):
     def _set_bunch_shift(self, values):
         #print("Setting bunch shifts: ", values)
 
+        #Banks are flipped!
+        #0x9320:  5,6,7,8
+        #0x9330:  1,2,3,4
+
+        bank1 = values[4:8]
+        bank2 = values[0:4]
+        adcs = bank1 + bank2
+
         base_reg = 0x9320
 
-        for i, val in enumerate(values):
+        for i, val in enumerate(adcs):
             reg = hex(base_reg+(i*4))
             set = "0x{0:08x}".format(val)
 
@@ -732,10 +740,13 @@ class BoardConfiguration(QtGui.QWidget):
             self.update('chip_delay', tmp , write=False)    
 
             # --[ read bunch shifts ] --
-            bunch_shifts = pci.read(self.identifier, reg='9320', amount=4, decimal=True)
+            #Banks are flipped!
+            #0x9320:  5,6,7,8
+            #0x9330:  1,2,3,4
+            bunch_shifts = pci.read(self.identifier, reg='9330', amount=4, decimal=True)
 
             if adc_number > 4:
-                bunch_shifts = bunch_shifts + pci.read(self.identifier, reg='9330', amount=4, decimal=True)
+                bunch_shifts = bunch_shifts + pci.read(self.identifier, reg='9320', amount=4, decimal=True)
             self.update('bunch_shift', bunch_shifts, write=False)    
 
             # --[ read and set th delay ]--