summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-09-01 16:59:03 -0700
committerJosh Blum <josh@joshknows.com>2011-09-01 17:10:33 -0700
commitd749591997afb66bdf90c5a3e2dcd4010ba4b8cf (patch)
tree617038195c89e188bb6b322e4708ceb7789c681a /host
parent31cdaa9feb4009885d8b4e90d5fddff3565a9257 (diff)
downloaduhd-d749591997afb66bdf90c5a3e2dcd4010ba4b8cf.tar.gz
uhd-d749591997afb66bdf90c5a3e2dcd4010ba4b8cf.tar.bz2
uhd-d749591997afb66bdf90c5a3e2dcd4010ba4b8cf.zip
xcvr2450: fix the locking at marginal frequencies
Diffstat (limited to 'host')
-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);