experiment: x5 harmonic mode

This commit is contained in:
TT 2019-08-10 15:28:26 +09:00
parent e626c581ee
commit a4ef290126
2 changed files with 12 additions and 3 deletions

10
main.c
View file

@ -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)

View file

@ -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;
}