Working!!!!

Removed_REF_marker
erikkaashoek 5 years ago
parent 94e620bf0d
commit fae783f2a9

@ -873,10 +873,11 @@ config_t config = {
.harmonic_freq_threshold = 300000000, .harmonic_freq_threshold = 300000000,
#endif #endif
.vbat_offset = 500, .vbat_offset = 500,
.frequency_IF2 = 2048600000,
.low_level_offset = 100, // Uncalibrated .low_level_offset = 100, // Uncalibrated
.high_level_offset = 100, // Uncalibrated .high_level_offset = 100, // Uncalibrated
.correction_frequency = { 10000, 100000, 200000, 500000, 50000000, 140000000, 200000000, 300000000, 330000000, 350000000 }, .correction_frequency = { 10000, 100000, 200000, 500000, 50000000, 140000000, 200000000, 300000000, 330000000, 350000000 },
.correction_value = { +6.0, +2.8, +1.6, -0.4, 0.0, -0.4, +0.4, +3.0, +4.0, +8.1 }, .correction_value = { 0, 0, 0, 0, 0.0, 0, 0, 0, 0, 0 },
.cor_am = -14, .cor_am = -14,
.cor_wfm = -17, .cor_wfm = -17,
.cor_nfm = -17, .cor_nfm = -17,

@ -67,7 +67,10 @@ void update_min_max_freq(void)
switch(setting.mode) { switch(setting.mode) {
case M_LOW: case M_LOW:
minFreq = 0; minFreq = 0;
if (config.frequency_IF2 == 0)
maxFreq = 350000000; maxFreq = 350000000;
else
maxFreq = config.frequency_IF2;
break; break;
#ifdef __ULTRA__ #ifdef __ULTRA__
case M_ULTRA: case M_ULTRA:
@ -132,7 +135,7 @@ void reset_settings(int m)
setting.repeat = 1; setting.repeat = 1;
setting.tracking_output = false; setting.tracking_output = false;
setting.measurement = M_OFF; setting.measurement = M_OFF;
setting.frequency_IF = 433800000; setting.frequency_IF = 433600000;
setting.auto_IF = true; setting.auto_IF = true;
setting.offset = 0.0; setting.offset = 0.0;
setting.trigger = T_AUTO; setting.trigger = T_AUTO;
@ -386,6 +389,7 @@ void set_IF2(int f)
config.frequency_IF2 = f; config.frequency_IF2 = f;
dirty = true; dirty = true;
config_save();
} }
#define POWER_STEP 0 // Should be 5 dB but appearently it is lower #define POWER_STEP 0 // Should be 5 dB but appearently it is lower
@ -931,8 +935,8 @@ void calculate_step_delay(void)
#endif #endif
#ifdef __SI4463__ #ifdef __SI4463__
if (actual_rbw_x10 >= 2700) { SI4432_step_delay = 400; SI4432_offset_delay = 100; } if (actual_rbw_x10 >= 2700) { SI4432_step_delay = 400; SI4432_offset_delay = 100; }
else if (actual_rbw_x10 >= 800) { SI4432_step_delay = 400; 150; SI4432_offset_delay = 100; } else if (actual_rbw_x10 >= 800) { SI4432_step_delay = 500; SI4432_offset_delay = 100; }
else if (actual_rbw_x10 >= 250) { SI4432_step_delay = 1000; 450; SI4432_offset_delay = 100; } else if (actual_rbw_x10 >= 250) { SI4432_step_delay = 1000; SI4432_offset_delay = 100; }
else { SI4432_step_delay = 5000; SI4432_offset_delay =1600; } else { SI4432_step_delay = 5000; SI4432_offset_delay =1600; }
#endif #endif
if (setting.step_delay_mode == SD_PRECISE) // In precise mode wait twice as long for RSSI to stabalize if (setting.step_delay_mode == SD_PRECISE) // In precise mode wait twice as long for RSSI to stabalize
@ -1028,8 +1032,8 @@ uint32_t peakFreq;
int peakIndex; int peakIndex;
float temppeakLevel; float temppeakLevel;
int temppeakIndex; int temppeakIndex;
static unsigned long old_freq[4] = { 0, 0, 0, 0}; static unsigned long old_freq[5] = { 0, 0, 0, 0,0};
static unsigned long real_old_freq[4] = { 0, 0, 0, 0}; static unsigned long real_old_freq[5] = { 0, 0, 0, 0,0};
// volatile int t; // volatile int t;
//static uint32_t extra_vbw_step_time = 0; //static uint32_t extra_vbw_step_time = 0;
@ -1042,10 +1046,10 @@ void setupSA(void)
#ifdef __SI4432__ #ifdef __SI4432__
SI4432_Init(); SI4432_Init();
#endif #endif
old_freq[0] = 0; for (int i = 0; i < sizeof(old_freq)/sizeof(unsigned long) ; i++) {
old_freq[1] = 0; old_freq[i] = 0;
real_old_freq[0] = 0; real_old_freq[i] = 0;
real_old_freq[1] = 0; }
#ifdef __SI4432__ #ifdef __SI4432__
SI4432_Sel = SI4432_RX ; SI4432_Sel = SI4432_RX ;
SI4432_Receive(); SI4432_Receive();
@ -1158,11 +1162,11 @@ void set_freq(int V, unsigned long freq) // translate the requested frequency
} }
} }
if (freq) { if (freq) {
ADF4351_set_frequency(V-2,freq,3); ADF4351_set_frequency(V-ADF4351_LO,freq,3);
real_old_freq[V] = freq; real_old_freq[V] = freq;
} }
} else if (V==ADF4351_LO2){ } else if (V==ADF4351_LO2){
ADF4351_set_frequency(V-2,freq,3); ADF4351_set_frequency(V-ADF4351_LO,freq,3);
} else } else
if (V==SI4463_RX) { if (V==SI4463_RX) {
if (setting.frequency_step<930000) // maximum step size is 937.49kHz if (setting.frequency_step<930000) // maximum step size is 937.49kHz
@ -1173,7 +1177,7 @@ void set_freq(int V, unsigned long freq) // translate the requested frequency
} }
#ifdef __ULTRA_SA__ #ifdef __ULTRA_SA__
else { else {
ADF4351_set_frequency(V-2,freq,3); ADF4351_set_frequency(V-ADF4351_LO,freq,3);
} }
#endif #endif
old_freq[V] = freq; old_freq[V] = freq;
@ -1443,11 +1447,11 @@ search_maximum(int m, int center, int span)
} }
//static int spur_old_stepdelay = 0; //static int spur_old_stepdelay = 0;
static const unsigned int spur_IF = 433800000; // The IF frequency for which the spur table is value static const unsigned int spur_IF = 433600000; // The IF frequency for which the spur table is value
static const unsigned int spur_alternate_IF = 433900000; // if the frequency is found in the spur table use this IF frequency static const unsigned int spur_alternate_IF = 433900000; // if the frequency is found in the spur table use this IF frequency
static const int spur_table[] = // Frequencies to avoid static const int spur_table[] = // Frequencies to avoid
{ {
#if 1 #if 0
// 580000, // 433.8 MHz table // 580000, // 433.8 MHz table
// 880000, //? // 880000, //?
960000, 960000,
@ -1765,7 +1769,7 @@ modulation_again:
local_IF = 0; local_IF = 0;
else { else {
if (setting.auto_IF) if (setting.auto_IF)
local_IF = setting.spur_removal ? 433900000 : spur_IF; local_IF = setting.spur_removal ? 433600000 : spur_IF;
else else
local_IF = setting.frequency_IF; local_IF = setting.frequency_IF;
} }
@ -3329,7 +3333,7 @@ void test_prepare(int i)
{ {
setting.tracking = false; //Default test setup setting.tracking = false; //Default test setup
setting.atten_step = false; setting.atten_step = false;
setting.frequency_IF = 433800000; // Default frequency setting.frequency_IF = 433600000; // Default frequency
setting.auto_IF = true; setting.auto_IF = true;
setting.auto_attenuation = false; setting.auto_attenuation = false;
switch(test_case[i].setup) { // Prepare test conditions switch(test_case[i].setup) { // Prepare test conditions
@ -3481,7 +3485,7 @@ void self_test(int test)
reset_settings(M_LOW); reset_settings(M_LOW);
test_prepare(TEST_SILENCE); test_prepare(TEST_SILENCE);
setting.auto_IF = false; setting.auto_IF = false;
setting.frequency_IF=433000000; setting.frequency_IF=433600000;
setting.frequency_step = 30000; setting.frequency_step = 30000;
if (setting.test_argument > 0) if (setting.test_argument > 0)
setting.frequency_step=setting.test_argument; setting.frequency_step=setting.test_argument;
@ -3541,7 +3545,7 @@ void self_test(int test)
in_selftest = true; in_selftest = true;
// reset_settings(M_LOW); // reset_settings(M_LOW);
setting.auto_IF = false; setting.auto_IF = false;
setting.frequency_IF=433900000; setting.frequency_IF=433600000;
ui_mode_normal(); ui_mode_normal();
test_prepare(TEST_RBW); test_prepare(TEST_RBW);
setting.step_delay = 8000; setting.step_delay = 8000;

@ -901,7 +901,7 @@ float Simulated_SI4432_RSSI(uint32_t i, int s)
uint32_t registers[6] = {0xA00000, 0x8000011, 0x4E42, 0x4B3,0xDC003C , 0x580005} ; //10 MHz ref uint32_t registers[6] = {0xA00000, 0x8000011, 0x4E42, 0x4B3,0xDC003C , 0x580005} ; //10 MHz ref
int debug = 0; int debug = 0;
int ADF4351_LE[2] = { 10, 10}; int ADF4351_LE[2] = { 10, 11};
int ADF4351_Mux = 7; int ADF4351_Mux = 7;

@ -184,9 +184,9 @@ extern const int SI4432_RBW_count;
extern si446x_info_t SI4463_info; extern si446x_info_t SI4463_info;
void Si446x_getInfo(si446x_info_t* info); void Si446x_getInfo(si446x_info_t* info);
void SI4463_init(void); void SI4463_init(void);
#define ADF4351_LO 2 #define ADF4351_LO 3
#define ADF4351_LO2 4 #define ADF4351_LO2 4
#define SI4463_RX 3 #define SI4463_RX 2
#endif #endif

@ -444,6 +444,7 @@ static const struct {
{keypads_plusmin , "COR\nAM"}, // KM_COR_AM {keypads_plusmin , "COR\nAM"}, // KM_COR_AM
{keypads_plusmin , "COR\nWFM"}, // KM_COR_WFM {keypads_plusmin , "COR\nWFM"}, // KM_COR_WFM
{keypads_plusmin , "COR\nNFM"}, // KM_COR_NFM {keypads_plusmin , "COR\nNFM"}, // KM_COR_NFM
{keypads_freq , "IF2"}, // KM_IF2
}; };
// ===[MENU CALLBACKS]========================================================= // ===[MENU CALLBACKS]=========================================================

Loading…
Cancel
Save

Powered by TurnKey Linux.