Эх сурвалжийг харах

working 512 pixels gui led still to be fixed, delays seems working now

meghana-soleil-pc 3 жил өмнө
parent
commit
288b740deb
14 өөрчлөгдсөн 257 нэмэгдсэн , 43 устгасан
  1. 28 16
      GUI.py
  2. 2 2
      align_clock.sh
  3. 3 3
      full_sequence.sh
  4. 3 6
      full_sequence_ex_rf.sh
  5. 137 0
      offset_soleil.sh
  6. 12 7
      pll_62_5.sh
  7. 7 0
      reset.sh
  8. 8 0
      reset_ex_rf.sh
  9. 8 8
      set_dac_voltages_25.sh
  10. 48 0
      set_ib_ds.sh
  11. 1 1
      status.sh
  12. BIN
      strip_data.pyc
  13. BIN
      temp.bin
  14. BIN
      temp_bg.bin

+ 28 - 16
GUI.py

@@ -73,6 +73,13 @@ class Ui_MainWindow(object):
         self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
         self.t1_vertical.addWidget(self.graphicsView)
 
+
+        #
+        # pic = QtGui.QLabel(window)
+        # pic.setGeometry(10, 10, 400, 100)
+        # #use full ABSOLUTE path to the image, not relative
+        # pic.setPixmap(QtGui.QPixmap(os.getcwd() + "/logo.png"))
+
         # TAB for modulation view
         self.imView = pg.GraphicsLayoutWidget()
         self.modplot = self.imView.addPlot()
@@ -340,7 +347,7 @@ class Ui_MainWindow(object):
         self.spinBox_int_delay.setMaximumSize(QtCore.QSize(300, 16777215))
         self.spinBox_int_delay.setObjectName(_fromUtf8("spinBox_int_delay"))
         self.spinBox_int_delay.setRange(1,1023)
-        self.spinBox_int_delay.setSingleStep(8)
+        self.spinBox_int_delay.setSingleStep(1)
         self.gridLayout.addWidget(self.spinBox_int_delay, 3, 1, 1, 1)
 
         ## GOTT gain
@@ -639,14 +646,14 @@ class Ui_MainWindow(object):
         self.label_log.setObjectName(_fromUtf8("label_log"))
         self.verticalLayout_9.addWidget(self.label_log)
 
-        self.checkBox_cont_acq = QtGui.QCheckBox(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
-        sizePolicy.setHorizontalStretch(0)
-        sizePolicy.setVerticalStretch(0)
-        sizePolicy.setHeightForWidth(self.checkBox_cont_acq.sizePolicy().hasHeightForWidth())
-        self.checkBox_cont_acq.setSizePolicy(sizePolicy)
-        self.checkBox_cont_acq.setObjectName(_fromUtf8("checkBox_cont_acq"))
-        self.verticalLayout_9.addWidget(self.checkBox_cont_acq)
+        # self.checkBox_cont_acq = QtGui.QCheckBox(self.centralwidget)
+        # sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        # sizePolicy.setHorizontalStretch(0)
+        # sizePolicy.setVerticalStretch(0)
+        # sizePolicy.setHeightForWidth(self.checkBox_cont_acq.sizePolicy().hasHeightForWidth())
+        # self.checkBox_cont_acq.setSizePolicy(sizePolicy)
+        # self.checkBox_cont_acq.setObjectName(_fromUtf8("checkBox_cont_acq"))
+        # self.verticalLayout_9.addWidget(self.checkBox_cont_acq)
 
         self.pushButton_run = QtGui.QPushButton(self.centralwidget)
         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
@@ -1195,7 +1202,8 @@ class Ui_MainWindow(object):
             return str(self.lineEdit_file_path.text() + 'f' + self.lineEdit_fillnum.text() + '_' + filename_timestamp() + '_' + self.lineEdit_detector.text())
 
         def readout_modulated():
-            self.checkBox_cont_acq.setCheckState(0)
+            #self.checkBox_cont_acq.setCheckState(0)
+            #self.pushButton_run.setCheckState(0)
             if self.checkBox_savefile.isChecked():
                 output_file = (get_filename() + '_m.bin')
             else:
@@ -1224,7 +1232,8 @@ class Ui_MainWindow(object):
 
         def readout_background():
             global background_data
-            self.checkBox_cont_acq.setCheckState(0)
+            #self.checkBox_cont_acq.setCheckState(0)
+            #self.pushButton_run.setCheckState(0)
             if self.checkBox_savefile.isChecked():
                 output_file = (get_filename() + '_b.bin')
             else:
@@ -1254,7 +1263,8 @@ class Ui_MainWindow(object):
 
         def readout_unmodulated():
             global unmodulated_data
-            self.checkBox_cont_acq.setCheckState(0)
+            #self.checkBox_cont_acq.setCheckState(0)
+            #self.pushButton_run.setCheckState(0)
             if self.checkBox_savefile.isChecked():
                 output_file = (get_filename() + '_u.bin')
             else:
@@ -1384,7 +1394,8 @@ class Ui_MainWindow(object):
                     self.textEdit.insertPlainText(u'\u26A0' + ' Communication failed with FPGA board... Check FPGA, the PCI-Express connection and reboot')
                 else:
                     self.spinBox_int_time.setValue(read_int_time_value())
-                    self.spinBox_int_delay.setValue(read_int_delay_value())
+                    self.spinBox_int_delay.setValue(read_register("INTEG_DELAY"))
+                    #self.spinBox_int_delay.setValue(read_int_delay_value())
                     self.spinBox_gott_gain.setValue(read_register("GOTT_GAIN"))
                     self.spinBox_total_samples.setValue(read_register("FT_TO_ACQ"))
                     self.spinBox_skip_samples.setValue(read_register("FT_SKIP"))
@@ -1480,7 +1491,8 @@ class Ui_MainWindow(object):
 
         # BUTTONS ACTIONS
         self.spinBox_int_time.valueChanged.connect(lambda: write_int_time_value())
-        self.spinBox_int_delay.valueChanged.connect(lambda: write_int_delay_value())
+        #self.spinBox_int_delay.valueChanged.connect(lambda: write_int_delay_value())
+        self.spinBox_gott_gain.valueChanged.connect(lambda: write_reg("INTEG_DELAY",self.spinBox_int_delay.text()))
         self.spinBox_gott_gain.valueChanged.connect(lambda: write_reg("GOTT_GAIN",self.spinBox_gott_gain.text()))
         self.spinBox_total_samples.valueChanged.connect(lambda: write_reg("FT_TO_ACQ",self.spinBox_total_samples.text()))
         self.spinBox_skip_samples.valueChanged.connect(lambda: write_reg("FT_SKIP",self.spinBox_skip_samples.text()))
@@ -1505,7 +1517,7 @@ class Ui_MainWindow(object):
         self.timer = pg.QtCore.QTimer()
         #self.timer.timeout.connect(plot_waveform)
         self.timer.timeout.connect(terminal_cmd_run)
-        self.timer.timeout.connect(terminal_cmd_checkbox)
+        #self.timer.timeout.connect(terminal_cmd_checkbox)
         self.timer.start(10)
 
         self.retranslateUi(MainWindow)
@@ -1563,7 +1575,7 @@ class Ui_MainWindow(object):
 
         self.label_acq.setText(_translate("MainWindow", "Acquire data", None))
         self.label_acq.setFont(boldFont)
-        self.checkBox_cont_acq.setText(_translate("MainWindow", "Live preview", None))
+        ##self.checkBox_cont_acq.setText(_translate("MainWindow", "Live preview", None))
         # self.checkBox_ELOG.setText(_translate("MainWindow", "Create ELOG entry", None))
         self.checkBox_savefile.setText(_translate("MainWindow", "Save File", None))
         self.pushButton_modulated.setText(_translate("MainWindow", "Modulated", None))

+ 2 - 2
align_clock.sh

@@ -41,10 +41,10 @@ echo "*CLOCK: Alignment...."
 # pci -w 9040 10210f00
 # sleep 0.05
 
-pci -w 9088 600
+pci -w 9088 6d6
 sleep 0.05
 
-pci -w 908C 600
+pci -w 908C 6d6
 sleep 0.05
 
 

+ 3 - 3
full_sequence.sh

@@ -62,15 +62,15 @@ pci -w 0x9028 0x0
 sleep 0.1
 
 #echo "Gotthard ON ... "
-./align_clock.sh
-#./align_clock_b.sh
+#./align_clock.sh
 sleep 0.1
 
 
 pci -w 0x910C 0
 sleep 0.1
 ./adc_offset_at_0_delay.sh
-
+sleep 0.1
+./offset_soleil.sh
 #pci -w 0x910C e
 #sleep 0.1
 

+ 3 - 6
full_sequence_ex_rf.sh

@@ -10,9 +10,6 @@ echo "PLL INIT/CONF for KARA 62.5 MHz ... "
 ./pll_62_5.sh
 sleep 0.1
 
-#./pll_sync.sh
-#sleep 0.1
-
 echo "AXI_MASTER on FPGA INIT ..."
 ./AXI_conf.sh
 sleep 0.1
@@ -63,16 +60,16 @@ sleep 0.1
 
 #echo "Gotthard ON ... "
 #./align_clock.sh
-#./align_clock_b.sh
 sleep 0.1
 
 
 pci -w 0x910C 0
 sleep 0.1
 ./adc_offset_at_0_delay.sh
-
+sleep 0.1
+./offset_soleil.sh
 #pci -w 0x910C e
 #sleep 0.1
 
-pci -w 0x910C 2f
+pci -w 0x910C 32
 sleep 0.1

+ 137 - 0
offset_soleil.sh

@@ -0,0 +1,137 @@
+pci -w 0x90A0 0x00038120                 #01 is 14bit mode, 000 is 12x, 001 is 14x, 100 is 16x, 011 is 10x
+sleep 0.05
+
+pci -w 0x90A0  0x0038016b
+sleep 0.05
+pci -w 0x90A0  0x0036017a
+sleep 0.05
+pci -w 0x90A0  0x0034016f
+sleep 0.05
+pci -w 0x90A0  0x00320165
+sleep 0.05
+pci -w 0x90A0  0x002C016d
+sleep 0.05
+pci -w 0x90A0  0x002A0168
+sleep 0.05
+pci -w 0x90A0  0x00280185
+sleep 0.05
+pci -w 0x90A0  0x0026019c
+sleep 0.05
+pci -w 0x90A0  0x0037017d
+sleep 0.05
+pci -w 0x90A0  0x00350190
+sleep 0.05
+pci -w 0x90A0  0x00330150
+sleep 0.05
+pci -w 0x90A0  0x0031017a
+sleep 0.05
+pci -w 0x90A0  0x002B01b4
+sleep 0.05
+pci -w 0x90A0  0x0029016b
+sleep 0.05
+pci -w 0x90A0  0x002701cd
+sleep 0.05
+pci -w 0x90A0  0x002501f0
+sleep 0.05
+pci -w 0x90A0  0x001F01db
+sleep 0.05
+pci -w 0x90A0  0x001D01b6
+sleep 0.05
+pci -w 0x90A0  0x001B01ab
+sleep 0.05
+pci -w 0x90A0  0x001901b6
+sleep 0.05
+pci -w 0x90A0  0x001301ac
+sleep 0.05
+pci -w 0x90A0  0x001101c5
+sleep 0.05
+pci -w 0x90A0  0x000F01ff
+sleep 0.05
+pci -w 0x90A0  0x000D01fd
+sleep 0.05
+pci -w 0x90A0  0x002001c4
+sleep 0.05
+pci -w 0x90A0  0x001E017c
+sleep 0.05
+pci -w 0x90A0  0x001C0189
+sleep 0.05
+pci -w 0x90A0  0x001A0182
+sleep 0.05
+pci -w 0x90A0  0x00140162
+sleep 0.05
+pci -w 0x90A0  0x00120187
+sleep 0.05
+pci -w 0x90A0  0x00100158
+sleep 0.05
+pci -w 0x90A0  0x000E019a
+sleep 0.05
+
+
+#ADC2 0x90A4
+pci -w 0x90A4 0x00038120                 #01 is 14bit mode, 000 is 12x, 001 is 14x, 100 is 16x, 011 is 10x
+sleep 0.05
+
+pci -w 0x90A4  0x000E01d5
+sleep 0.05
+pci -w 0x90A4  0x001001de
+sleep 0.05
+pci -w 0x90A4  0x001201a7
+sleep 0.05
+pci -w 0x90A4  0x001401ab
+sleep 0.05
+pci -w 0x90A4  0x001A01d4
+sleep 0.05
+pci -w 0x90A4  0x001C0172
+sleep 0.05
+pci -w 0x90A4  0x001E01a8
+sleep 0.05
+pci -w 0x90A4  0x0020017d
+sleep 0.05
+pci -w 0x90A4  0x000D01d8
+sleep 0.05
+pci -w 0x90A4  0x000F01d1
+sleep 0.05
+pci -w 0x90A4  0x001101af
+sleep 0.05
+pci -w 0x90A4  0x0013016c
+sleep 0.05
+pci -w 0x90A4  0x001901f0
+sleep 0.05
+pci -w 0x90A4  0x001B018b
+sleep 0.05
+pci -w 0x90A4  0x001D017c
+sleep 0.05
+pci -w 0x90A4  0x001F0188
+sleep 0.05
+pci -w 0x90A4  0x002501d7
+sleep 0.05
+pci -w 0x90A4  0x002701c8
+sleep 0.05
+pci -w 0x90A4  0x002901c4
+sleep 0.05
+pci -w 0x90A4  0x002B01b6
+sleep 0.05
+pci -w 0x90A4  0x003101d9
+sleep 0.05
+pci -w 0x90A4  0x003301d0
+sleep 0.05
+pci -w 0x90A4  0x0035018a
+sleep 0.05
+pci -w 0x90A4  0x0037018d
+sleep 0.05
+pci -w 0x90A4  0x002601a3
+sleep 0.05
+pci -w 0x90A4  0x00280188
+sleep 0.05
+pci -w 0x90A4  0x002A017e
+sleep 0.05
+pci -w 0x90A4  0x002C01b8
+sleep 0.05
+pci -w 0x90A4  0x003201b5
+sleep 0.05
+pci -w 0x90A4  0x0034018d
+sleep 0.05
+pci -w 0x90A4  0x003601b9
+sleep 0.05
+pci -w 0x90A4  0x0038018a
+sleep 0.05

+ 12 - 7
pll_62_5.sh

@@ -42,11 +42,11 @@ pci -w 0x9064 0x00070600   # clock enable
 sleep 0.2
 
 #echo "*PLL: R3 "
-pci -w 0x9064 0x00070603          # clk_ADC_2    working:0x000704b3
+pci -w 0x9064 0x000706f3          # clk_ADC_2    working:0x000704b3
 sleep 0.2
 
 #echo "*PLL: R4 "
-pci -w 0x9064 0x00070604          # clk_ADC_1    working:0x000704b3
+pci -w 0x9064 0x000706f4          # clk_ADC_1    working:0x000704b3
 sleep 0.2
 
 #echo "*PLL: R5 "
@@ -65,24 +65,29 @@ echo "*PLL: R8 "
 pci -w 0x9064 0x10000908
 sleep 0.2
 
-echo "*PLL: R9 "
-pci -w 0x9064 0xA0022A09
+echo "*PLL: R9 No Vboost"
+#pci -w 0x9064 0xA0022A09
+pci -w 0x9064 0xA0032A09
 sleep 0.2
 
-echo "*PLL: RB (R11)"
+echo "*PLL: RB"
 pci -w 0x9064 0x0082800B
+#pci -w 0x9064 0x0082000B
 sleep 0.2
 
 echo "*PLL: RD (R13)"
 pci -w 0x9064 0x028F800D
+#pci -w 0x9064 0x028F80AD
 sleep 0.2
 
-echo "*PLL: RE (R14)"
+echo "*PLL: RE"
 pci -w 0x9064 0x0830020E
+#pci -w 0x9064 0x08000A0E
 sleep 0.2
 
-echo "*PLL: RF (R15)"
+echo "*PLL: RF"
 pci -w 0x9064 0xC800180F
+#pci -w 0x9064 0xC800780F
 sleep 0.2
 
 

+ 7 - 0
reset.sh

@@ -25,6 +25,13 @@ pci -w 904C 8
 sleep 0.1
 
 
+###################################################
+# echo "----------> reset of the clock align stage"
+# pci -w 9040 10310f00
+# sleep 0.05
+# pci -w 9040 10210f00
+# sleep 0.05
+
 ####################################################
 echo "RESET of the KALYPSO"
 pci -w 9040 0x800ff

+ 8 - 0
reset_ex_rf.sh

@@ -42,6 +42,14 @@ echo "SETTING FOR 512 PIXELS"
 pci -w 904C 009
 sleep 0.1
 
+
+###################################################
+# echo "----------> reset of the clock align stage"
+# pci -w 9040 10310f00
+# sleep 0.05
+# pci -w 9040 10210f00
+# sleep 0.05
+
 ####################################################
 echo "RESET of the KALYPSO"
 pci -w 9040 0x800ff # -- enable internal clock

+ 8 - 8
set_dac_voltages_25.sh

@@ -20,35 +20,35 @@ echo "***Configuring DACs***"
 
 
 echo "DAC0: CH0 = VB_COLBUFFER 29uA"
-pci -w 9068 000800        #original value is 750
+pci -w 9068 000820        #original value is 750
 sleep 0.1
 
 echo "DAC0: CH2 = VB_COLBUFFER 29uA"
-pci -w 9068 020800
+pci -w 9068 020820
 sleep 0.1
 
 echo "DAC1: CH0 = VB_COLBUFFER 29uA"
-pci -w 906C 000800
+pci -w 906C 000820
 sleep 0.1
 
 echo "DAC1: CH2 = VB_COLBUFFER 29uA"
-pci -w 906C 020800
+pci -w 906C 020820
 sleep 0.1
 
 echo "DAC3: CH0 = VB_COLBUFFER 29uA"
-pci -w 9074 000800
+pci -w 9074 000820
 sleep 0.1
 
 echo "DAC3: CH2 = VB_COLBUFFER 29uA"
-pci -w 9074 020800
+pci -w 9074 020820
 sleep 0.1
 
 echo "DAC4: CH0 = VB_COLBUFFER 29uA"
-pci -w 9078 000800
+pci -w 9078 000820
 sleep 0.1
 
 echo "DAC4: CH2 = VB_COLBUFFER 29uA"
-pci -w 9078 020800
+pci -w 9078 020820
 sleep 0.1
 
 

+ 48 - 0
set_ib_ds.sh

@@ -0,0 +1,48 @@
+#!/bin/sh
+
+
+#echo "ADC & GOT: Turning on power..."
+#pci -w 9048 f0
+#sleep 0.1
+
+echo "***Configuring DACs***"
+
+#I2C_DAC_0 = h9068
+#I2C_DAC_1 = h906C
+#I2C_DAC_2 = h9070
+#I2C_DAC_3 = h9074
+#I2C_DAC_4 = h9078
+#I2C_DAC_5 = h907C
+
+
+echo "DAC0: CH1 = IB_DS 28uA"
+pci -w 9068 010$1
+sleep 0.1
+
+echo "DAC0: CH3 = IB_DS 28uA"
+pci -w 9068 030$1
+sleep 0.1
+
+echo "DAC1: CH1 = IB_DS 28uA"
+pci -w 906C 010$1
+sleep 0.1
+
+echo "DAC1: CH3 = IB_DS 28uA"
+pci -w 906C 030$1
+sleep 0.1
+
+echo "DAC3: CH1 = IB_DS 28uA"
+pci -w 9074 010$1
+sleep 0.1
+
+echo "DAC3: CH3 = IB_DS 28uA"
+pci -w 9074 030$1
+sleep 0.1
+
+echo "DAC4: CH1 = IB_DS 28uA"
+pci -w 9078 010$1
+sleep 0.1
+
+echo "DAC4: CH3 = IB_DS 28uA"
+pci -w 9078 030$1
+sleep 0.1

+ 1 - 1
status.sh

@@ -2,5 +2,5 @@
 
 echo "*************************"
 echo "** KALYPSO STATUS "
-pci -r 0x9000 -s 50
+pci -r 0x9000 -s 100
 echo "*************************"

BIN
strip_data.pyc


BIN
temp.bin


BIN
temp_bg.bin