Removed_REF_marker
erikkaashoek 5 years ago
parent 2b94f8e9c2
commit 07c91fd709

@ -275,10 +275,6 @@ VNA_SHELL_FUNCTION(cmd_if)
int a = my_atoi(argv[0]); int a = my_atoi(argv[0]);
if (a!= 0 &&( a < (DEFAULT_IF - 2000000) || a>(DEFAULT_IF + 2000000))) if (a!= 0 &&( a < (DEFAULT_IF - 2000000) || a>(DEFAULT_IF + 2000000)))
goto usage; goto usage;
#ifdef __SI4463__
if (a!= 0 &&( a < 977000000 || a>980000000))
goto usage;
#endif
setting.auto_IF = false; setting.auto_IF = false;
set_IF(a); set_IF(a);
} }

@ -153,8 +153,9 @@ void reset_settings(int m)
case M_LOW: case M_LOW:
minFreq = 0; minFreq = 0;
maxFreq = 4000000000; maxFreq = 4000000000;
set_sweep_frequency(ST_START, (uint32_t) 0); set_sweep_frequency(ST_START, minFreq);
set_sweep_frequency(ST_STOP, (uint32_t) DEFAULT_MAX_FREQ); set_sweep_frequency(ST_STOP, maxFreq);
set_sweep_frequency(ST_STOP, 800000000); // TODO <----------------- temp ----------------------
setting.attenuate = 0.0; // <---------------- WARNING ----------------- setting.attenuate = 0.0; // <---------------- WARNING -----------------
setting.auto_attenuation = false; // <---------------- WARNING ----------------- setting.auto_attenuation = false; // <---------------- WARNING -----------------
setting.sweep_time_us = 0; setting.sweep_time_us = 0;
@ -174,13 +175,6 @@ void reset_settings(int m)
setting.sweep_time_us = 10*ONE_SECOND_TIME; setting.sweep_time_us = 10*ONE_SECOND_TIME;
break; break;
case M_HIGH: case M_HIGH:
#ifdef __ULTRA_SA__
minFreq = 00000000;
maxFreq = 2000000000;
#else
minFreq = HIGH_MIN_FREQ_MHZ*(config.setting_frequency_10mhz/10);
maxFreq = HIGH_MAX_FREQ_MHZ*(config.setting_frequency_10mhz/10);
#endif
set_sweep_frequency(ST_START, minFreq); set_sweep_frequency(ST_START, minFreq);
set_sweep_frequency(ST_STOP, maxFreq); set_sweep_frequency(ST_STOP, maxFreq);
setting.sweep_time_us = 0; setting.sweep_time_us = 0;
@ -233,12 +227,7 @@ uint32_t calc_min_sweep_time_us(void) // Estimate minimum sweep time in
void set_refer_output(int v) void set_refer_output(int v)
{ {
setting.refer = v; setting.refer = v;
#ifdef __SI4432__
set_calibration_freq(setting.refer); set_calibration_freq(setting.refer);
#endif
#ifdef __SI4463__
Si4463_set_refer(setting.refer);
#endif
// dirty = true; // dirty = true;
} }
@ -1154,8 +1143,6 @@ void setupSA(void)
#define OFFSET_LOWER_BOUND 0 #define OFFSET_LOWER_BOUND 0
#endif #endif
static uint32_t old_frequency_step;
void set_freq(int V, unsigned long freq) // translate the requested frequency into a setting of the SI4432 void set_freq(int V, unsigned long freq) // translate the requested frequency into a setting of the SI4432
{ {
if (old_freq[V] == freq) // Do not change HW if not needed if (old_freq[V] == freq) // Do not change HW if not needed
@ -1242,11 +1229,7 @@ void set_freq(int V, unsigned long freq) // translate the requested frequency
real_old_freq[V] = ADF4351_set_frequency(V-ADF4351_LO,freq,setting.drive-12); real_old_freq[V] = ADF4351_set_frequency(V-ADF4351_LO,freq,setting.drive-12);
} else } else
if (V==SI4463_RX) { if (V==SI4463_RX) {
if (setting.frequency_step<930000) // maximum step size is 937.49kHz SI4463_set_freq(freq);
SI4463_set_freq(freq,setting.frequency_step);
else
SI4463_set_freq(freq,100);
old_frequency_step = setting.frequency_step;
} }
#ifdef __ULTRA_SA__ #ifdef __ULTRA_SA__
else { else {
@ -1422,13 +1405,12 @@ void update_rbw(void) // calculate the actual_rbw and the vbwSteps (#
if (setting.spur_removal && actual_rbw_x10 > 3000) if (setting.spur_removal && actual_rbw_x10 > 3000)
actual_rbw_x10 = 2500; // if spur suppression reduce max rbw to fit within BPF actual_rbw_x10 = 2500; // if spur suppression reduce max rbw to fit within BPF
SI4432_Sel = MODE_SELECT(setting.mode); SI4432_Sel = MODE_SELECT(setting.mode);
actual_rbw_x10 = set_rbw(actual_rbw_x10); // see what rbw the SI4432 can realize
#endif #endif
#ifdef __SI4463__ #ifdef __SI4463__
// if (setting.spur_removal && actual_rbw_x10 > 3000) // Will depend on BPF width <------------------ TODO ------------------------- // if (setting.spur_removal && actual_rbw_x10 > 3000) // Will depend on BPF width <------------------ TODO -------------------------
// actual_rbw_x10 = 3000; // if spur suppression reduce max rbw to fit within BPF // actual_rbw_x10 = 3000; // if spur suppression reduce max rbw to fit within BPF
actual_rbw_x10 = set_rbw(actual_rbw_x10); // see what rbw the SI4432 can realize
#endif #endif
actual_rbw_x10 = set_rbw(actual_rbw_x10); // see what rbw the SI4432 can realize
if (setting.frequency_step > 0 && MODE_INPUT(setting.mode)) { // When doing frequency scanning in input mode if (setting.frequency_step > 0 && MODE_INPUT(setting.mode)) { // When doing frequency scanning in input mode
vbwSteps = ((int)(2 * (setting.vbw_x10 + (actual_rbw_x10/2)) / actual_rbw_x10)); // calculate # steps in between each frequency step due to rbw being less than frequency step vbwSteps = ((int)(2 * (setting.vbw_x10 + (actual_rbw_x10/2)) / actual_rbw_x10)); // calculate # steps in between each frequency step due to rbw being less than frequency step
if (setting.step_delay_mode==SD_PRECISE) // if in Precise scanning if (setting.step_delay_mode==SD_PRECISE) // if in Precise scanning
@ -1587,36 +1569,6 @@ static const int spur_table[] = // Frequencies t
41600000, 41600000,
49650000, 49650000,
#endif #endif
#ifdef IF_AT_4339
780000, // 433.9MHz table
830000,
880000,
949000,
1390000,
1468000,
1830000,
1900000,
2770000,
2840000,
2880000,
4710000,
4780000,
4800000,
4880000,
6510000,
6750000,
6790000,
6860000,
7340000,
8100000,
8200000,
8880000,
// 9970000, 10MHz!!!!!!
10870000,
11420000,
14880000,
16820000,
#endif
}; };
int binary_search(int f) int binary_search(int f)

@ -1532,7 +1532,7 @@ void SI4463_clear_int_status()
} }
void Si4463_set_refer(int ref) void set_calibration_freq(int ref)
{ {
ref = 0; // <--------------------- DISABLED FOR PROTOTYPE!!!!!!!!!!!!!!!!!!!!!!!!! ref = 0; // <--------------------- DISABLED FOR PROTOTYPE!!!!!!!!!!!!!!!!!!!!!!!!!
@ -2063,12 +2063,9 @@ uint16_t set_rbw(uint16_t WISH) {
static int refresh_count = 0; static int refresh_count = 0;
void SI4463_set_freq(uint32_t freq, uint32_t step_size) void SI4463_set_freq(uint32_t freq)
{ {
(void) step_size;
// SI4463_set_gpio(3,GPIO_HIGH); // SI4463_set_gpio(3,GPIO_HIGH);
int S = 4 ; // Aprox 100 Hz channels int S = 4 ; // Aprox 100 Hz channels
SI4463_channel = 0; SI4463_channel = 0;
if (freq >= 822000000 && freq <= 1140000000) { // till 1140MHz if (freq >= 822000000 && freq <= 1140000000) { // till 1140MHz

Loading…
Cancel
Save

Powered by TurnKey Linux.