diff --git a/main.c b/main.c index 2ffa905..35a25c6 100644 --- a/main.c +++ b/main.c @@ -132,10 +132,14 @@ int set_frequency(int freq) if (frequency == freq) return delay; + if (freq > 900000000 && frequency <= 900000000) { + tlv320aic3204_set_gain(95, 95); + delay += 10; + } else if (freq > FREQ_HARMONICS && frequency <= FREQ_HARMONICS) { tlv320aic3204_set_gain(30, 30); delay += 10; - } + } else if (freq <= FREQ_HARMONICS && frequency > FREQ_HARMONICS) { tlv320aic3204_set_gain(0, 0); delay += 10; @@ -531,6 +535,7 @@ void sweep(void) goto rewind; } set_frequency(frequencies[0]); + tlv320aic3204_select_in3(); // CH0:REFLECT //if (cal_status & CALSTAT_APPLY) // apply_error_term(); @@ -623,7 +628,8 @@ freq_mode_centerspan(void) #define START_MIN 50000 -#define STOP_MAX 900000000 +//#define STOP_MAX 900000000 +#define STOP_MAX 1500000000 void set_sweep_frequency(int type, float frequency) diff --git a/si5351.c b/si5351.c index 9ef42d5..6590493 100644 --- a/si5351.c +++ b/si5351.c @@ -309,7 +309,10 @@ si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength) int delay = 3; uint32_t ofreq = freq + offset; uint32_t rdiv = SI5351_R_DIV_1; - if (freq > 300000000) { + if (freq > 900000000) { + freq /= 5; + ofreq /= 7; + } else if (freq > 300000000) { freq /= 3; ofreq /= 5; }