From bfe97dfb801c0b5624fe1a915e8c7f41defe2349 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 1 Sep 2011 16:59:03 -0700 Subject: xcvr2450: fix the locking at marginal frequencies --- host/lib/usrp/dboard/db_xcvr2450.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index b88eb2a95..bfd4421b8 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -114,6 +114,7 @@ private: max2829_regs_t _max2829_regs; void set_lo_freq(double target_freq); + void set_lo_freq_core(double target_freq); void set_tx_ant(const std::string &ant); void set_rx_ant(const std::string &ant); void set_tx_gain(double gain, const std::string &name); @@ -274,6 +275,16 @@ void xcvr2450::update_atr(void){ * Tuning **********************************************************************/ void xcvr2450::set_lo_freq(double target_freq){ + //tune the LO and sleep a bit for lock + //if not locked, try some carrier offsets + for (double offset = 0.0; offset <= 3e6; offset+=1e6){ + this->set_lo_freq_core(target_freq + offset); + boost::this_thread::sleep(boost::posix_time::milliseconds(50)); + if (this->get_locked()) return; + } +} + +void xcvr2450::set_lo_freq_core(double target_freq){ //clip the input to the range target_freq = xcvr_freq_range.clip(target_freq); -- cgit v1.2.3