From a5b3a10fe4db258b267d686a91b845e4375dfdc8 Mon Sep 17 00:00:00 2001 From: Ignas J Date: Wed, 6 Nov 2019 12:24:03 +0200 Subject: [PATCH] Dont tune pll after loading INI if VCO is disabled --- src/API/lms7_device.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/API/lms7_device.cpp b/src/API/lms7_device.cpp index 2ea9f945a..05680e016 100644 --- a/src/API/lms7_device.cpp +++ b/src/API/lms7_device.cpp @@ -1656,9 +1656,14 @@ int LMS7_Device::LoadConfig(const char *filename, int ind) if (lms->LoadConfig(filename)==0) { //tune PLLs as saved VCO settings may not work - lms->SetFrequencySX(false, lms->GetFrequencySX(false)); - lms->SetFrequencySX(true, lms->GetFrequencySX(true)); - lms->TuneVCO(lime::LMS7002M::VCO_CGEN); + lms->Modify_SPI_Reg_bits(LMS7param(MAC), 1); + if (!lms->Get_SPI_Reg_bits(LMS7param(PD_VCO))) + lms->SetFrequencySX(false, lms->GetFrequencySX(false)); + lms->Modify_SPI_Reg_bits(LMS7param(MAC), 2); + if (!lms->Get_SPI_Reg_bits(LMS7param(PD_VCO))) + lms->SetFrequencySX(true, lms->GetFrequencySX(true)); + if (!lms->Get_SPI_Reg_bits(LMS7param(PD_VCO_CGEN))) + lms->TuneVCO(lime::LMS7002M::VCO_CGEN); lms->Modify_SPI_Reg_bits(LMS7param(MAC),1,true); return SetFPGAInterfaceFreq(-1, -1, -1000, -1000); }