SuperKEKB XRM system  Not logged in ELOG logo
Message ID: 3     Entry time: Tue May 3 08:11:06 2016
Author: M. Andrew 
Type: documentation 
Subject: what was done in January 2016 

Here is a data dump of everything that happened on the asus laptop while getting the laste 2015 / early 2016 incarnation of the XRM tested before being delivered to KEK on the weekend of January 24th.  Everything was done in bash and the firmware only addressed one carrier at a time, so the purpose of this elog entry is simply to archive the information.

Attachment 1: howtogetdata.mza  408 Bytes  | Show | Hide all
Attachment 2: 2016-01-24.XRM-history  14 kB  | Show | Hide all
Attachment 3: 2016-01-24.XRM-code-chanes.patch  6 kB  | Hide | Hide all
Index: CarrierRevE/images/CarrierRevE_PS_app_E0000001.elf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: CarrierRevE/src/CarrierRevE.h
===================================================================
--- CarrierRevE/src/CarrierRevE.h	(revision 1143)
+++ CarrierRevE/src/CarrierRevE.h	(working copy)
@@ -13,6 +13,10 @@
 #define GPIO_DEVICE_ID XPAR_XGPIOPS_0_DEVICE_ID
 
 //#define CLK_FAN_RST_N_PIN 48
+#define XRM_ARP_SELECT_ST1 16 // gain stage 1
+#define XRM_ARP_SELECT_ST2 19 // gain stage 2
+#define XRM_ARP_SELECT_ST3 18 // gain stage 3
+#define XRM_ARP_SELECT_ST4 43 // attenuator
 #define SPI_CLOCK0_PIN    16 //MIO16 FOR SPI CLOCK
 #define SPI_MOSI0_PIN    21 //MIO17 FOR SPI MOSI
 #define SPI_CS0_PIN        18 //MIO18 FOR SPI CS0 (fanout clock)
Index: CarrierRevE/src/CarrierRevE_main.c
===================================================================
--- CarrierRevE/src/CarrierRevE_main.c	(revision 1143)
+++ CarrierRevE/src/CarrierRevE_main.c	(working copy)
@@ -83,10 +83,10 @@
       //bool temperatureAlert = regThermStatus & 0x1;
       
       // Debug pins
-      XGpioPs_WritePin(&Gpio, 46, (carrierId & 0x1) >> 0);
-      XGpioPs_WritePin(&Gpio, 47, (carrierId & 0x2) >> 1);
-      XGpioPs_WritePin(&Gpio, 48, (carrierId & 0x4) >> 2);
-      XGpioPs_WritePin(&Gpio, 49, (carrierId & 0x8) >> 3);
+      //XGpioPs_WritePin(&Gpio, 46, (carrierId & 0x1) >> 0);
+      //XGpioPs_WritePin(&Gpio, 47, (carrierId & 0x2) >> 1);
+      //XGpioPs_WritePin(&Gpio, 48, (carrierId & 0x4) >> 2);
+      //XGpioPs_WritePin(&Gpio, 49, (carrierId & 0x8) >> 3);
       // Check control signals in from PL
       // If they've changed then write out new values to devices
       u32 AsicRegEnNew = Xil_In32(AXI_ASIC_REG_EN_ADDR);
@@ -163,17 +163,23 @@
 
 /***********************FUNCTION DEFINITIONS*****************************/
 void GPIO_init(u16 DeviceId){
-
     XGpioPs_Config *ConfigPtr;
-
     //Initialize the GPIO driver.
     ConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);
     XGpioPs_CfgInitialize(&Gpio, ConfigPtr, ConfigPtr->BaseAddr);
-
 }
 
 void GPIO_pins(void){
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST1, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST1, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST2, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST2, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST3, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST3, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST4, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST4, 1); // enables the output driver
 
+
     XGpioPs_SetDirectionPin(&Gpio, SPI_CLOCK0_PIN, 1); //set SPI0 as output direction
     XGpioPs_SetOutputEnablePin(&Gpio, SPI_CLOCK0_PIN, 1); //enables the output for the SPI0
     XGpioPs_SetDirectionPin(&Gpio, SPI_MOSI0_PIN, 1); //set MOSI as output direction
@@ -193,6 +199,7 @@
     XGpioPs_SetDirectionPin(&Gpio, 51, 0);
     XGpioPs_SetOutputEnablePin(&Gpio, 51, 0);
 
+/*
     //Debugging (using JTAG as GPIO)
     XGpioPs_SetDirectionPin(&Gpio, 46, 1);
     XGpioPs_SetOutputEnablePin(&Gpio, 46, 1);
@@ -202,6 +209,7 @@
     XGpioPs_SetOutputEnablePin(&Gpio, 48, 1);
     XGpioPs_SetDirectionPin(&Gpio, 49, 1);
     XGpioPs_SetOutputEnablePin(&Gpio, 49, 1);
+*/
 
     //Set direction and output enables for ASIC amp enables
     XGpioPs_SetDirectionPin(&Gpio, AMP_ASIC0_PIN, 1);
@@ -280,6 +288,11 @@
 void GPIO_defaults(void){
 	int cal_channel = 0;
 
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST1, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST2, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST3, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST4, 0x0);
+
     // Leave these disabed by default
     AMP_ASIC1_LO;
     AMP_ASIC2_LO;
Index: Scrod/src/main.c
===================================================================
--- Scrod/src/main.c	(revision 1143)
+++ Scrod/src/main.c	(working copy)
@@ -11,9 +11,15 @@
 #include "feature_extraction.h"
 #include "PL_AXI_REG.h"
 #include "i2c.h"
+#include "xgpiops.h" //PS GPIO
+#include "xil_io.h"
 
 #define RAW_DATAFORMAT_CARRIER 1 	// assumes carrier format for raw data
 
+#define XRM_ARP_SELECT_ST1 16 // gain stage 1
+#define XRM_ARP_SELECT_ST2 19 // gain stage 2
+#define XRM_ARP_SELECT_ST3 18 // gain stage 3
+#define XRM_ARP_SELECT_ST4 43 // attenuator
 
 #ifdef RAW_DATAFORMAT_CARRIER
 
@@ -28,8 +34,18 @@
 int dataTransferOn = 0;
 #define WAVE_BUFFER_SIZE 600  // Needs to stay below 6-7 MB
 
+#define GPIO_DEVICE_ID XPAR_XGPIOPS_0_DEVICE_ID
+XGpioPs Gpio; //driver instance for GPIO device
+
+/***********************FUNCTION DEFINITIONS*****************************/
+void GPIO_init(u16 DeviceId){
+    XGpioPs_Config *ConfigPtr;
+    //Initialize the GPIO driver.
+    ConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);
+    XGpioPs_CfgInitialize(&Gpio, ConfigPtr, ConfigPtr->BaseAddr);
+}
+
 int main() {
-
     u32 returnval;
     volatile u32 featureExtractionMode;
 
@@ -38,6 +54,24 @@
     init_platform();
     print("Hello World\n\r");
 
+    GPIO_init(GPIO_DEVICE_ID);
+    //GPIO_pins();
+    //GPIO_defaults();
+
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST1, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST1, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST2, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST2, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST3, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST3, 1); // enables the output driver
+    XGpioPs_SetDirectionPin(&Gpio,    XRM_ARP_SELECT_ST4, 1); // set as output direction
+    XGpioPs_SetOutputEnablePin(&Gpio, XRM_ARP_SELECT_ST4, 1); // enables the output driver
+ 
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST1, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST2, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST3, 0x0);
+    XGpioPs_WritePin(&Gpio, XRM_ARP_SELECT_ST4, 0x0);
+
     // Circular Waveform Buffer Init
     RawWaveformCarrier_t *g_waveBuffer = (RawWaveformCarrier_t*) memalign(4096,sizeof(RawWaveformCarrier_t) * WAVE_BUFFER_SIZE); // compiler has issues with large static arrays (~8MB), so dynamically just to be safe
     if(g_waveBuffer == NULL){
Attachment 4: XRM-fpga2-alias-output  1 kB  | Show | Hide all
Attachment 5: grab_all_peds  731 Bytes  | Show | Hide all
Attachment 6: mza.gnuplot  773 Bytes  | Show | Hide all
Attachment 7: IMG_1025.JPG  314 kB  | Show | Hide all
Attachment 8: IMG_1027.JPG  337 kB  | Show | Hide all
Attachment 9: IMG_1028.JPG  285 kB  | Show | Hide all
Attachment 10: 2016-01-24.LASER5.png  659 kB  | Show | Hide all
Attachment 11: 2016-01-24.LASER.png  614 kB  | Show | Hide all
Attachment 12: 2016-01-24.LASER14.png  640 kB  | Show | Hide all
Attachment 13: 2016-01-24.LASER13.png  671 kB  | Show | Hide all
Attachment 14: 2016-01-24.LASER12.png  619 kB  | Show | Hide all
Attachment 15: 2016-01-24.LASER11.png  641 kB  | Show | Hide all
Attachment 16: 2016-01-24.LASER9.png  638 kB  | Show | Hide all
Attachment 17: program-bit-and-elf-and-go.xmd.tcl  3 kB  | Show | Hide all
Attachment 18: setup_env_template.sh  4 kB  | Show | Hide all
Attachment 19: XRM.bashrc  3 kB  | Show | Hide all
ELOG V3.1.5-3a5f2f0