diff --git a/nanovna.h b/nanovna.h index e3a0687..ad998a5 100644 --- a/nanovna.h +++ b/nanovna.h @@ -68,7 +68,7 @@ #define DEFAULT_IF ((uint32_t)977100000) #define DEFAULT_SPUR_OFFSET ((uint32_t)1500000) #define DEFAULT_MAX_FREQ ((uint32_t)800000000) -#define HIGH_MIN_FREQ_MHZ 825 +#define HIGH_MIN_FREQ_MHZ 136// 825 #define HIGH_MAX_FREQ_MHZ 1130 #endif /* diff --git a/sa_cmd.c b/sa_cmd.c index 43e6b69..0441bd5 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -532,8 +532,26 @@ VNA_SHELL_FUNCTION(cmd_d) (void) argc; (void) argv; int32_t a = my_atoi(argv[0]); - setting.lo_drive=a; - dirty = true; + int32_t d; + if (argc == 2) + d = my_atoi(argv[1]); + else { + d = a; + a = 2; + } + switch (a) { + case 1: + SI4463_set_output_level(d); + break; + case 2: + ADF4351_drive (d); + break; + case 3: + ADF4351_aux_drive(d); + break; + } +// setting.lo_drive=a; +// dirty = true; } #if 0 diff --git a/sa_core.c b/sa_core.c index 9343e71..3718563 100644 --- a/sa_core.c +++ b/sa_core.c @@ -90,10 +90,10 @@ void update_min_max_freq(void) break; case M_GENHIGH: if (high_out_adf4350) { - minFreq = 135000000; + minFreq = 136000000; maxFreq = 4290000000U; } else { - minFreq = 850000000; + minFreq = 136000000; maxFreq = 1150000000U; } break; @@ -2468,6 +2468,9 @@ modulation_again: pureRSSI = SI4432_RSSI(lf, MODE_SELECT(setting.mode)); // Get RSSI, either from pre-filled buffer #endif #ifdef __SI4463__ + if (real_old_freq[SI4463_RX] == 0) + pureRSSI = 0; + else pureRSSI = Si446x_RSSI(); #endif //#define __DEBUG_FREQUENCY_SETTING__ diff --git a/si4432.c b/si4432.c index 7881332..5aa65c8 100644 --- a/si4432.c +++ b/si4432.c @@ -2362,30 +2362,29 @@ static int refresh_count = 0; uint32_t SI4463_set_freq(uint32_t freq) { // SI4463_set_gpio(3,GPIO_HIGH); - int S = 4 ; // Aprox 100 Hz channels + int S = 4 ; // Approx 100 Hz channels SI4463_channel = 0; - if (freq >= 822000000 && freq <= 1140000000) { // till 1140MHz + if (freq >= 822000000 && freq <= 1130000000) { // 822 to 1130MHz SI4463_band = 0; SI4463_outdiv = 4; -#if 0 // band 4 does not function - } else if (freq >= 568000000 && freq <= 758000000 ) { // works till 758MHz - SI4463_band = 4; - SI4463_outdiv = 6; -#endif - } else if (freq >= 420000000 && freq <= 568000000) { // works till 568MHz + } else if (freq >= 411000000 && freq <= 566000000) { // 411 to 568MHz SI4463_band = 2; SI4463_outdiv = 8; - } else if (freq >= 329000000 && freq <= 454000000) { // works till 454MHz + } else if (freq >= 329000000 && freq <= 454000000) { // 329 to 454MHz SI4463_band = 1; SI4463_outdiv = 10; - } else if (freq >= 274000000 && freq <= 339000000) { // to 339 + } else if (freq >= 274000000 && freq <= 378000000) { // 274 to 378 SI4463_band = 3; SI4463_outdiv = 12; - } else if (freq >= 136000000 && freq <= 190000000){ // 136 { // To 190 + } else if (freq >= 137000000 && freq <= 189000000){ // 137 to 189 SI4463_band = 5; SI4463_outdiv = 24; - } - if (SI4463_band == -1) +#if 0 // Band 4, 6 and 7 do not function + } else if (freq >= 137000000 && freq <= 189000000){ // 220 to 266 + SI4463_band = 4; + SI4463_outdiv = 12; +#endif + } else return 0; if (SI4463_offset_active) { si_set_offset(0);