aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-09-01 16:59:03 -0700
committerJosh Blum <josh@joshknows.com>2011-09-08 11:28:16 -0700
commitbfe97dfb801c0b5624fe1a915e8c7f41defe2349 (patch)
tree48b1e96e26c31f968c4c4ec12b64b12c3ca00da8 /host/lib/usrp
parentdfb30a5d35c4dfeac567c250b792e5d9a68e8a69 (diff)
downloaduhd-bfe97dfb801c0b5624fe1a915e8c7f41defe2349.tar.gz
uhd-bfe97dfb801c0b5624fe1a915e8c7f41defe2349.tar.bz2
uhd-bfe97dfb801c0b5624fe1a915e8c7f41defe2349.zip
xcvr2450: fix the locking at marginal frequencies
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp11
1 files changed, 11 insertions, 0 deletions
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);