From 63626c05f4c397659c217bde6baa7a1d7c8b4a3c Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sun, 18 Oct 2020 08:44:24 +0200 Subject: [PATCH] Frequency range adapted --- sa_core.c | 23 +++++++++++++++-------- si4432.c | 12 ++++++++++-- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/sa_core.c b/sa_core.c index b7b6b2c..70813c9 100644 --- a/sa_core.c +++ b/sa_core.c @@ -87,8 +87,8 @@ void update_min_max_freq(void) minFreq = 00000000; maxFreq = 2000000000; #else - minFreq = 24*config.setting_frequency_10mhz; - maxFreq = 96*config.setting_frequency_10mhz; + minFreq = 10*config.setting_frequency_10mhz; + maxFreq = 1200*config.setting_frequency_10mhz; #endif break; case M_GENHIGH: @@ -182,8 +182,8 @@ void reset_settings(int m) minFreq = 00000000; maxFreq = 2000000000; #else - minFreq = 13*config.setting_frequency_10mhz; - maxFreq = 120*config.setting_frequency_10mhz; + minFreq = 10*config.setting_frequency_10mhz; + maxFreq = 1200*config.setting_frequency_10mhz; #endif set_sweep_frequency(ST_START, minFreq); set_sweep_frequency(ST_STOP, maxFreq); @@ -1817,10 +1817,16 @@ modulation_again: // --------------------- IF know, set the RX SI4432 frequency ------------------------ #ifdef __SI4432__ - set_freq (SI4432_RX , local_IF); + if (setting.mode == M_LOW || setting.mode == M_GENLOW ) + { + set_freq (SI4432_RX , local_IF); + } #endif #ifdef __SI4463__ - set_freq (SI4463_RX , local_IF); + if (setting.mode == M_LOW || setting.mode == M_GENLOW) + { + set_freq (SI4463_RX , local_IF); + } #endif #ifdef __ULTRA__ } else if (setting.mode == M_ULTRA) { // No above/below IF mode in Ultra @@ -1891,7 +1897,7 @@ modulation_again: set_freq (ADF4351_LO, extra_IF+lf); // otherwise to above IF } } else if (setting.mode == M_HIGH) { - set_freq (SI4463_RX, local_IF+lf); // sweep RX, local_IF = 0 in high mode + set_freq (SI4463_RX, lf); // sweep RX, local_IF = 0 in high mode } // STOP_PROFILE; #endif @@ -2287,6 +2293,7 @@ sweep_again: // stay in sweep loop when output mo #define __MIRROR_MASKING__ #ifdef __MIRROR_MASKING__ +#ifdef __SI4432__ if (setting.mode == M_HIGH && setting.mirror_masking) { int mirror_offset = 2 * 937000 / setting.frequency_step; // int mask_start = 0; @@ -2310,7 +2317,7 @@ sweep_again: // stay in sweep loop when output mo } #endif - +#endif // -------------------------- auto attenuate ---------------------------------- #define AUTO_TARGET_LEVEL -25 #define AUTO_TARGET_WINDOW 2 diff --git a/si4432.c b/si4432.c index 83c3618..ada1efb 100644 --- a/si4432.c +++ b/si4432.c @@ -1947,21 +1947,29 @@ uint16_t SI4463_SET_RBW(uint16_t WISH) { #define Npresc 1 // 0=low / 1=High performance mode + + void SI4463_set_freq(uint32_t freq, uint32_t step_size) { int band; int outdiv; uint32_t offs = ((freq / 1000)* 0) / 1000; float RFout=(freq+offs)/1000000.0; // To MHz - if (RFout >= 820) { // till 1140MHz + if (RFout >= 822) { // till 1140MHz band = 0; outdiv = 4; + } else if (RFout >= 548) { // works till 760MHz + band = 1; + outdiv = 6; } else if (RFout >= 410) { // works till 570MHz band = 2; outdiv = 8; - } else if (RFout >= 272) { // to 380 + } else if (RFout >= 274) { // to 380 band = 3; outdiv = 12; + } else if (RFout >= 272) { // to 380 + band = 4; + outdiv = 16; } else { // 136 { // To 190 band = 5; outdiv = 24;