V0.2 working for board evaluation

tinySA-v0.2
erikkaashoek 6 years ago
parent 955973e57b
commit 6c1c5ea809

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="801836126330401537" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="834375144321394" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>

@ -131,7 +131,7 @@
PIN_MODE_ANALOG(GPIOA_XP) | \ PIN_MODE_ANALOG(GPIOA_XP) | \
PIN_MODE_ANALOG(GPIOA_YP) | \ PIN_MODE_ANALOG(GPIOA_YP) | \
PIN_MODE_ALTERNATE(GPIOA_MCO) | \ PIN_MODE_ALTERNATE(GPIOA_MCO) | \
PIN_MOD_ULTRA(9U) | \ PIN_MODE_INPUT(9U) | \
PIN_MODE_OUTPUT(GPIOA_USB_DISC) | \ PIN_MODE_OUTPUT(GPIOA_USB_DISC) | \
PIN_MODE_INPUT(GPIOA_USB_DM) | \ PIN_MODE_INPUT(GPIOA_USB_DM) | \
PIN_MODE_INPUT(GPIOA_USB_DP) | \ PIN_MODE_INPUT(GPIOA_USB_DP) | \

@ -2348,7 +2348,7 @@ VNA_SHELL_FUNCTION(cmd_m)
pause_sweep(); pause_sweep();
int32_t f_step = (frequencyStop-frequencyStart)/ points; int32_t f_step = (frequencyStop-frequencyStart)/ points;
palClearPad(GPIOC, GPIOC_LED); // disable led and wait for voltage stabilization palClearPad(GPIOB, GPIOB_LED); // disable led and wait for voltage stabilization
int old_step = setting_frequency_step; int old_step = setting_frequency_step;
setting_frequency_step = f_step; setting_frequency_step = f_step;
update_rbw(); update_rbw();
@ -2367,7 +2367,7 @@ VNA_SHELL_FUNCTION(cmd_m)
setting_frequency_step = old_step; setting_frequency_step = old_step;
update_rbw(); update_rbw();
resume_sweep(); resume_sweep();
palSetPad(GPIOC, GPIOC_LED); palSetPad(GPIOB, GPIOB_LED);
} }
VNA_SHELL_FUNCTION(cmd_p) VNA_SHELL_FUNCTION(cmd_p)

@ -1912,15 +1912,19 @@ static void cell_draw_marker_info(int x0, int y0)
float ir = logmag(&(actual_t[markers[3].index])); float ir = logmag(&(actual_t[markers[3].index]));
float sl = logmag(&(actual_t[markers[0].index])); float sl = logmag(&(actual_t[markers[0].index]));
float sr = logmag(&(actual_t[markers[1].index])); float sr = logmag(&(actual_t[markers[1].index]));
sl = (sl + sr)/2;
il = (il + ir)/2;
il = sl+ (sl - il)/2; float ip = sl+ (sr - il)/2;
plot_printf(buf, sizeof buf, "OIP3: %4.1fdB", il); plot_printf(buf, sizeof buf, "OIP3: %4.1fdB", ip);
j = 2; j = 2;
int xpos = 1 + (j%2)*(WIDTH/2) + CELLOFFSETX - x0; int xpos = 1 + (j%2)*(WIDTH/2) + CELLOFFSETX - x0;
int ypos = 1 + (j/2)*(16) - y0; int ypos = 1 + (j/2)*(16) - y0;
cell_drawstring_7x13(buf, xpos, ypos);
ip = sr+ (sl - ir)/2;
plot_printf(buf, sizeof buf, "OIP3: %4.1fdB", ip);
j = 3;
xpos = 1 + (j%2)*(WIDTH/2) + CELLOFFSETX - x0;
ypos = 1 + (j/2)*(16) - y0;
cell_drawstring_7x13(buf, xpos, ypos); cell_drawstring_7x13(buf, xpos, ypos);
break; break;
} }

@ -56,7 +56,7 @@ void reset_settings(int m)
setting_show_stored = 0; setting_show_stored = 0;
setting_auto_attenuation = true; setting_auto_attenuation = true;
setting_subtract_stored = 0; setting_subtract_stored = 0;
setting_drive=12; setting_drive=15;
setting_step_atten = 0; // Only used in low output mode setting_step_atten = 0; // Only used in low output mode
setting_agc = true; setting_agc = true;
setting_lna = false; setting_lna = false;
@ -974,7 +974,12 @@ again:
setFreq (2, IF_2 + lf); setFreq (2, IF_2 + lf);
setFreq (1, 433800000); setFreq (1, 433800000);
#else #else
setFreq (1, local_IF+lf); #ifdef BELOW_IF_BELOW_50MHZ
if (setting_mode == M_LOW && lf < 50000000)
setFreq (1, local_IF-lf);
else
#endif
setFreq (1, local_IF+lf);
#endif #endif
} }
if (MODE_OUTPUT(setting_mode)) // No substepping in output mode if (MODE_OUTPUT(setting_mode)) // No substepping in output mode
@ -1186,7 +1191,13 @@ static bool sweep(bool break_on_operation)
if (r < l) { if (r < l) {
l = markers[1].index; l = markers[1].index;
r = markers[0].index; r = markers[0].index;
markers[0].index = l;
markers[1].index = r;
} }
uint32_t lf = frequencies[l];
uint32_t rf = frequencies[r];
markers[2].enabled = search_maximum(2, lf - (rf - lf), 12);
markers[3].enabled = search_maximum(3, rf + (rf - lf), 12);
} else if (setting_measurement == M_PHASE_NOISE && markers[0].index > 10) { } else if (setting_measurement == M_PHASE_NOISE && markers[0].index > 10) {
markers[1].index = markers[0].index + (setting_mode == M_LOW ? 290/4 : -290/4); // Position phase noise marker at requested offset markers[1].index = markers[0].index + (setting_mode == M_LOW ? 290/4 : -290/4); // Position phase noise marker at requested offset
} else if (setting_measurement == M_STOP_BAND && markers[0].index > 10) { } else if (setting_measurement == M_STOP_BAND && markers[0].index > 10) {

@ -667,9 +667,10 @@ static void menu_measure_cb(int item, uint8_t data)
reset_settings(GetMode()); reset_settings(GetMode());
for (int i = 0; i< MARKERS_MAX; i++) { for (int i = 0; i< MARKERS_MAX; i++) {
markers[i].enabled = M_ENABLED; markers[i].enabled = M_ENABLED;
markers[i].mtype = M_DELTA | M_TRACKING; markers[i].mtype = M_DELTA;
} }
markers[0].mtype = M_REFERENCE | M_TRACKING; markers[0].mtype = M_REFERENCE | M_TRACKING;
markers[1].mtype = M_TRACKING;
kp_help_text = "Frequency of left signal"; kp_help_text = "Frequency of left signal";
ui_mode_keypad(KM_CENTER); ui_mode_keypad(KM_CENTER);
ui_process_keypad(); ui_process_keypad();
@ -679,7 +680,7 @@ static void menu_measure_cb(int item, uint8_t data)
ui_process_keypad(); ui_process_keypad();
int right = uistat.value; int right = uistat.value;
set_sweep_frequency(ST_CENTER, (left+right)/2); set_sweep_frequency(ST_CENTER, (left+right)/2);
set_sweep_frequency(ST_SPAN, (right - left)*4); set_sweep_frequency(ST_SPAN, (right - left)*5);
set_measurement(M_OIP3); set_measurement(M_OIP3);
break; break;
case M_PHASE_NOISE: // Phase noise case M_PHASE_NOISE: // Phase noise

Loading…
Cancel
Save

Powered by TurnKey Linux.