From 348ae82ccc961d4e20f10b92acea238ba6797519 Mon Sep 17 00:00:00 2001 From: Michael West Date: Thu, 27 Dec 2018 12:04:44 -0800 Subject: TwinRX: Fix tuning - Set SPI clock back to 3 MHz - Fix returned frequency for ADF5355 (rev A and B boards) --- host/lib/include/uhdlib/usrp/common/adf535x.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'host/lib/include/uhdlib') diff --git a/host/lib/include/uhdlib/usrp/common/adf535x.hpp b/host/lib/include/uhdlib/usrp/common/adf535x.hpp index 3c05890f1..39dfb4b2a 100644 --- a/host/lib/include/uhdlib/usrp/common/adf535x.hpp +++ b/host/lib/include/uhdlib/usrp/common/adf535x.hpp @@ -324,13 +324,10 @@ inline double adf535x_impl::_set_frequency(double target_freq, d const auto MOD2 = static_cast(std::min(floor(_pfd_freq / gcd), static_cast(ADF535X_MAX_MOD2))); const auto FRAC2 = static_cast(std::min(ceil(residue * MOD2), static_cast(ADF535X_MAX_FRAC2))); - const double coerced_vco_freq = _pfd_freq * ( - double(INT) + ( - (double(FRAC1) + - (double(FRAC2) / double(MOD2))) - / double(ADF535X_MOD1) - ) - ); + const double coerced_vco_freq = _pfd_freq * + (_fb_after_divider ? rf_divider : 1) * + (double(INT) + ((double(FRAC1) + (double(FRAC2) / double(MOD2))) / + double(ADF535X_MOD1))); const double coerced_out_freq = coerced_vco_freq / rf_divider; -- cgit v1.2.3