mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
experiment: x5 harmonic mode
This commit is contained in:
parent
e626c581ee
commit
a4ef290126
10
main.c
10
main.c
|
|
@ -132,10 +132,14 @@ int set_frequency(int freq)
|
||||||
if (frequency == freq)
|
if (frequency == freq)
|
||||||
return delay;
|
return delay;
|
||||||
|
|
||||||
|
if (freq > 900000000 && frequency <= 900000000) {
|
||||||
|
tlv320aic3204_set_gain(95, 95);
|
||||||
|
delay += 10;
|
||||||
|
} else
|
||||||
if (freq > FREQ_HARMONICS && frequency <= FREQ_HARMONICS) {
|
if (freq > FREQ_HARMONICS && frequency <= FREQ_HARMONICS) {
|
||||||
tlv320aic3204_set_gain(30, 30);
|
tlv320aic3204_set_gain(30, 30);
|
||||||
delay += 10;
|
delay += 10;
|
||||||
}
|
} else
|
||||||
if (freq <= FREQ_HARMONICS && frequency > FREQ_HARMONICS) {
|
if (freq <= FREQ_HARMONICS && frequency > FREQ_HARMONICS) {
|
||||||
tlv320aic3204_set_gain(0, 0);
|
tlv320aic3204_set_gain(0, 0);
|
||||||
delay += 10;
|
delay += 10;
|
||||||
|
|
@ -531,6 +535,7 @@ void sweep(void)
|
||||||
goto rewind;
|
goto rewind;
|
||||||
}
|
}
|
||||||
set_frequency(frequencies[0]);
|
set_frequency(frequencies[0]);
|
||||||
|
tlv320aic3204_select_in3(); // CH0:REFLECT
|
||||||
|
|
||||||
//if (cal_status & CALSTAT_APPLY)
|
//if (cal_status & CALSTAT_APPLY)
|
||||||
// apply_error_term();
|
// apply_error_term();
|
||||||
|
|
@ -623,7 +628,8 @@ freq_mode_centerspan(void)
|
||||||
|
|
||||||
|
|
||||||
#define START_MIN 50000
|
#define START_MIN 50000
|
||||||
#define STOP_MAX 900000000
|
//#define STOP_MAX 900000000
|
||||||
|
#define STOP_MAX 1500000000
|
||||||
|
|
||||||
void
|
void
|
||||||
set_sweep_frequency(int type, float frequency)
|
set_sweep_frequency(int type, float frequency)
|
||||||
|
|
|
||||||
5
si5351.c
5
si5351.c
|
|
@ -309,7 +309,10 @@ si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength)
|
||||||
int delay = 3;
|
int delay = 3;
|
||||||
uint32_t ofreq = freq + offset;
|
uint32_t ofreq = freq + offset;
|
||||||
uint32_t rdiv = SI5351_R_DIV_1;
|
uint32_t rdiv = SI5351_R_DIV_1;
|
||||||
if (freq > 300000000) {
|
if (freq > 900000000) {
|
||||||
|
freq /= 5;
|
||||||
|
ofreq /= 7;
|
||||||
|
} else if (freq > 300000000) {
|
||||||
freq /= 3;
|
freq /= 3;
|
||||||
ofreq /= 5;
|
ofreq /= 5;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue