Temperature compensation

pull/34/head
erikkaashoek 4 years ago
parent c224fa9af6
commit a4e8b7d98c

@ -2103,16 +2103,21 @@ VNA_SHELL_FUNCTION(cmd_help)
(void)argc;
(void)argv;
const VNAShellCommand *scp = commands;
#ifdef TINYSA4
shell_printf("config.ini commands:");
#endif
while (scp->sc_name != NULL
#ifdef __SINGLE_LETTER__
&& scp->sc_function != cmd_y
#endif
) {
#ifdef TINYSA4
if (scp->flags & CMD_RUN_IN_LOAD)
#endif
shell_printf(" %s", scp->sc_name);
scp++;
}
#ifdef TINYSA4
scp = commands;
shell_printf("\r\nOther commands:");
while (scp->sc_name != NULL
@ -2124,7 +2129,8 @@ VNA_SHELL_FUNCTION(cmd_help)
shell_printf(" %s", scp->sc_name);
scp++;
}
// shell_printf("\r\nEnter for more info: {command} ?\r\n");
#endif
shell_printf("\r\n");
return;
}

@ -52,7 +52,7 @@
#define __ADF4351__
#define __NEW_SWITCHES__
#define __ULTRA_OUT__ // Use ADF output over LOW out
// #define __SI5351__
#define __SI5351__
#endif
#define __PE4302__
//#define __SIMULATION__

@ -1020,7 +1020,7 @@ void set_modulation(int m)
void set_modulation_frequency(int f)
{
if (50 <= f && f <= 7000) {
if (50 <= f && f <= 6000) {
setting.modulation_frequency = f;
dirty = true;
}
@ -3176,7 +3176,7 @@ static void calculate_static_correction(void) // Calculate the
- (S_STATE(setting.agc)? 0 : 33)
- (S_STATE(setting.lna)? 12 : 0)
+ (setting.extra_lna ? -26.5 : 0) // checked
+ (setting.mode == M_GENLOW ? (Si446x_get_temp() - 35.0) / 13.0 : 0) // About 7.7dB per 10 degrees C
+ (setting.mode == M_GENLOW ? (Si446x_get_temp() - 35.0) / 13.0 : (Si446x_get_temp() - 35.0) / 20.0) // About 7.7dB per 10 degrees C in output mode, 1 dB per 20 degrees in input mode
#endif
- setting.external_gain);
}

@ -800,7 +800,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb)
}
#ifdef TINYSA4
static const int item_to_mode[3] = { 0,2,3 };
static const int item_to_mode[2] = { 0,2 };
#else
static const int item_to_mode[4] = { 0,1,2,3 };
#endif
@ -2513,7 +2513,7 @@ static const menuitem_t menu_modulation[] = {
{ MT_FORM | MT_ADV_CALLBACK, MO_NFM, "Narrow FM", menu_modulation_acb},
{ MT_FORM | MT_ADV_CALLBACK, MO_WFM, "Wide FM", menu_modulation_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_LOW, MO_EXTERNAL, "External", menu_modulation_acb},
{ MT_FORM | MT_KEYPAD, KM_MODULATION, "FREQ: %s", "50Hz..6kHz"},
{ MT_FORM | MT_KEYPAD, KM_MODULATION, "FREQ: %s", "50Hz..5kHz"},
{ MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
};
@ -2526,9 +2526,9 @@ static const menuitem_t menu_sweep[] = {
};
#ifdef TINYSA4
static const menuitem_t menu_lowoutput_settings[] = {
{ MT_FORM | MT_ADV_CALLBACK, 0, "SQUARE WAVE max 4.4GHz", menu_lowoutput_settings_acb},
{ MT_FORM | MT_ADV_CALLBACK, 1, "MIXER max 5.4GHz", menu_lowoutput_settings_acb},
{ MT_FORM | MT_SUBMENU, 255, S_RARROW" Settings", menu_settings},
{ MT_FORM | MT_ADV_CALLBACK, 0, "Cleanest signal, max 4.4GHz", menu_lowoutput_settings_acb},
{ MT_FORM | MT_ADV_CALLBACK, 1, "Highest accuracy, max 5.4GHz", menu_lowoutput_settings_acb},
{ MT_FORM | MT_SUBMENU, 255, S_RARROW"Expert Settings", menu_settings},
{ MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
};
#endif
@ -3182,7 +3182,7 @@ const menuitem_t menu_mode[] = {
// { MT_FORM | MT_TITLE, 0, "tinySA MODE", NULL},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_LOW_INPUT+I_SA, "Spectrum Analyzer", menu_mode_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_LOW_OUTPUT+I_SINUS, "Signal Generator", menu_mode_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_OUTPUT+I_GEN, "%s to HIGH out", menu_mode_acb},
// { MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_OUTPUT+I_GEN, "%s to HIGH out", menu_mode_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_CONNECT+I_GEN, "Calibration Output: %s", menu_sreffer_acb},
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
};

Loading…
Cancel
Save

Powered by TurnKey Linux.