WIP: detect integer spurs

This commit is contained in:
Jan Käberich 2025-02-26 08:55:31 +01:00
parent b6f26eb6dc
commit 72e2a331da
3 changed files with 15 additions and 3 deletions

View file

@ -60,6 +60,14 @@ public:
uint64_t GetActualFrequency() {
return outputFrequency;
}
uint32_t DistanceToIntegerSpur() {
uint32_t dist = outputFrequency % f_PFD;
if(dist > f_PFD / 2) {
return f_PFD - dist;
} else {
return dist;
}
}
private:
static constexpr uint64_t MaxFreq = 6100000000; // 6GHz according to datasheet, but slight overclocking is possible

View file

@ -452,6 +452,10 @@ void VNA::SweepHalted() {
}
if (pointCnt == 0) {
last_LO2 = HW::getIF1() - HW::getIF2();
Si5351.SetPLL(Si5351C::PLL::B, last_LO2*HW::LO2Multiplier, HW::Ref::getSource());
Si5351.ResetPLL(Si5351C::PLL::B);
Si5351.WaitForLock(Si5351C::PLL::B, 10);
HAL_Delay(2);
}