mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
Better solutiom of prev fixes (reload si5351 settings on sweep begin)
This commit is contained in:
parent
23c765b719
commit
597c2c2958
9
main.c
9
main.c
|
|
@ -804,18 +804,11 @@ bool sweep(bool break_on_operation)
|
||||||
// blink LED while scanning
|
// blink LED while scanning
|
||||||
palClearPad(GPIOC, GPIOC_LED);
|
palClearPad(GPIOC, GPIOC_LED);
|
||||||
// Power stabilization after LED off, also align timings on i == 0
|
// Power stabilization after LED off, also align timings on i == 0
|
||||||
|
|
||||||
// !!!!! Don`t understand why si5351 non stable on band 2 then change from band 3
|
|
||||||
// It fixed if set before one band 1 frequency
|
|
||||||
// Possibly problem in gain, call only si5351_set_frequency_with_offset not work
|
|
||||||
// Also it allow align sweep timings
|
|
||||||
set_frequency(50000000);
|
|
||||||
DSP_START(1);DSP_WAIT_READY;
|
|
||||||
for (i = 0; i < sweep_points; i++) { // 5300
|
for (i = 0; i < sweep_points; i++) { // 5300
|
||||||
if (frequencies[i] == 0) break;
|
if (frequencies[i] == 0) break;
|
||||||
delay = set_frequency(frequencies[i]); // 700
|
delay = set_frequency(frequencies[i]); // 700
|
||||||
tlv320aic3204_select(0); // 60 CH0:REFLECT, reset and begin measure
|
tlv320aic3204_select(0); // 60 CH0:REFLECT, reset and begin measure
|
||||||
DSP_START(delay); // 1900
|
DSP_START(delay+((i==0)?1:0)); // 1900
|
||||||
//================================================
|
//================================================
|
||||||
// Place some code thats need execute while delay
|
// Place some code thats need execute while delay
|
||||||
//================================================
|
//================================================
|
||||||
|
|
|
||||||
7
si5351.c
7
si5351.c
|
|
@ -380,13 +380,16 @@ si5351_set_frequency_with_offset(uint32_t freq, uint8_t drive_strength){
|
||||||
int delay = DELAY_NORMAL;
|
int delay = DELAY_NORMAL;
|
||||||
if (freq == current_freq)
|
if (freq == current_freq)
|
||||||
return delay;
|
return delay;
|
||||||
|
else if (current_freq > freq) // Reset band on sweep begin (if set range 150-600, fix error then 600 MHz band 2 or 3 go back)
|
||||||
|
current_band = 0;
|
||||||
|
current_freq = freq;
|
||||||
uint32_t ofreq = freq + current_offset;
|
uint32_t ofreq = freq + current_offset;
|
||||||
uint32_t mul = 1, omul = 1;
|
uint32_t mul = 1, omul = 1;
|
||||||
uint32_t rdiv = SI5351_R_DIV_1;
|
uint32_t rdiv = SI5351_R_DIV_1;
|
||||||
uint32_t fdiv;
|
uint32_t fdiv;
|
||||||
// Fix possible uncorrect input
|
// Fix possible incorrect input
|
||||||
drive_strength&=SI5351_CLK_DRIVE_STRENGTH_MASK;
|
drive_strength&=SI5351_CLK_DRIVE_STRENGTH_MASK;
|
||||||
current_freq = freq;
|
|
||||||
if (freq >= config.harmonic_freq_threshold * 7U) {
|
if (freq >= config.harmonic_freq_threshold * 7U) {
|
||||||
mul = 9;
|
mul = 9;
|
||||||
omul = 11;
|
omul = 11;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue