aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2018-12-27 12:04:44 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-02 15:51:09 -0800
commit348ae82ccc961d4e20f10b92acea238ba6797519 (patch)
tree78432b251b941a2e58708a0ee55bdbf6ba9aeb47 /host
parentbfbedb7999c18d1e0610920fb3e24bac1aff8698 (diff)
downloaduhd-348ae82ccc961d4e20f10b92acea238ba6797519.tar.gz
uhd-348ae82ccc961d4e20f10b92acea238ba6797519.tar.bz2
uhd-348ae82ccc961d4e20f10b92acea238ba6797519.zip
TwinRX: Fix tuning
- Set SPI clock back to 3 MHz - Fix returned frequency for ADF5355 (rev A and B boards)
Diffstat (limited to 'host')
-rw-r--r--host/lib/include/uhdlib/usrp/common/adf535x.hpp11
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp2
2 files changed, 5 insertions, 8 deletions
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<adf5355_regs_t>::_set_frequency(double target_freq, d
const auto MOD2 = static_cast<uint16_t>(std::min(floor(_pfd_freq / gcd), static_cast<double>(ADF535X_MAX_MOD2)));
const auto FRAC2 = static_cast<uint16_t>(std::min(ceil(residue * MOD2), static_cast<double>(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;
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
index 0b7c8674c..7ed01f624 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
@@ -27,7 +27,7 @@ namespace {
const double TWINRX_DESIRED_REFERENCE_FREQ = 50e6;
const double TWINRX_REV_AB_PFD_FREQ = 6.25e6;
const double TWINRX_REV_C_PFD_FREQ = 12.5e6;
- const double TWINRX_SPI_CLOCK_FREQ = 10e6;
+ const double TWINRX_SPI_CLOCK_FREQ = 3e6;
}
class twinrx_ctrl_impl : public twinrx_ctrl {