diff --git a/sw/config b/sw/config index ed34935..d2f9e96 100644 --- a/sw/config +++ b/sw/config @@ -2,13 +2,14 @@ # #Each line of this file defines a configuration slot and consists of integer numbers delimited by white #spaces in the following order: -#ADDSUB_MODE ADD_INPUT_MUX DELAY FACTOR TIMESTAMP +#ADDSUB_MODE ADD_INPUT_MUX DELAY FACTOR0 FACTOR1 TIMESTAMP # -#ADDSUB_MODE: Select feedback mode (0=negative, 1=positive) -#ADD_INPUT_MUX: Select feedback input (0=GND[only ADC Input 1], 1=ADC Input 2[Both ADC inputs are used]) -#DELAY: Clock cycles counts (50 ns period) to delay the feedback signal [0-255] -#FACTOR: Multiplication factor to apply to the feedback signal [0-16] (NOTE: Integer is intepreted as a 1Q4 Fixed Point Number!) +#ADDSUB_MODE: Select feedback mode (0=Negative, 1=Positive) +#ADD_INPUT_MUX: Select feedback input (0=Single Input Mode [ADC0], 1=Double Input Mode) +#DELAY: Clock cycles counts (50 ns period) to delay the feedback signal [0-65535] +#FACTOR0: Multiplication factor to apply to the ADC Signal0 [0-32] (NOTE: Integer is intepreted as a Q1.4 Fixed Point Number!) +#FACTOR1: Multiplication factor to apply to the ADC Signal1 [0-32] (NOTE: Integer is intepreted as a Q1.4 Fixed Point Number!) #TIMESTAMP: Defines the clock count number from the sync pulse from which on the configurations settings will be applied. [32-bit unsigned integer] # First Config slot should have a timestamp equal to zero. -1 0 0 8 0 -0 0 0 8 1200000000 +1 0 0 8 8 0 +0 0 0 8 8 1200000000 diff --git a/sw/out b/sw/out deleted file mode 100644 index 285b4a8..0000000 Binary files a/sw/out and /dev/null differ diff --git a/sw/read_debug b/sw/read_debug deleted file mode 100755 index 8122e6c..0000000 Binary files a/sw/read_debug and /dev/null differ diff --git a/sw/write_config b/sw/write_config deleted file mode 100755 index ef38376..0000000 Binary files a/sw/write_config and /dev/null differ diff --git a/sw/write_config.c b/sw/write_config.c index e57da5e..3fe1439 100644 --- a/sw/write_config.c +++ b/sw/write_config.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]){ return -1; } - uint64_t data, addsub_mode, add_input_mode, delay, factor, timestamp; + uint64_t data, addsub_mode, add_input_mode, delay, factor1, factor2, timestamp; /*File Parsing Loop*/ while(getline(&line, &len, src) != -1){ @@ -46,7 +46,7 @@ int main(int argc, char *argv[]){ continue; } - if(sscanf(line, "%u %u %u %u %u", &addsub_mode, &add_input_mode, &delay, &factor, ×tamp) < 5){ + if(sscanf(line, "%u %u %u %u %u %u", &addsub_mode, &add_input_mode, &delay, &factor1, &factor2, ×tamp) < 5){ perror("Parsing of configuration file failed"); fprintf(stderr, "Failing line: %s", line); bail(); @@ -54,8 +54,8 @@ int main(int argc, char *argv[]){ } data = 0x0; - data |= ((uint64_t)0x1 << 63) | ((addsub_mode & 0x1) << 62) | ((add_input_mode & 0x1) << 61) | ((delay & 0xFF) << 40) | - ((factor & 0x1F) << 32) | (timestamp & 0xFFFFFFFF); + data |= ((uint64_t)0x1 << 63) | ((addsub_mode & 0x1) << 62) | ((add_input_mode & 0x1) << 61) | ((delay & 0xFF) << 42) | + ((factor1 & 0x1F) << 37) | ((factor2 & 0x1F) << 32) | (timestamp & 0xFFFFFFFF); if(write(dest, &data, sizeof(uint64_t)) != sizeof(uint64_t)){ perror("Failed to write data"); bail(); @@ -66,10 +66,10 @@ int main(int argc, char *argv[]){ //Write A non enabled slot data = 0x0; if(write(dest, &data, sizeof(uint64_t)) != sizeof(uint64_t)){ - perror("Failed to write data"); - bail(); - return -1; - } + perror("Failed to write data"); + bail(); + return -1; + } //Exit safely bail();