From 01e5d630d9d5525b46d2814808a974084f1e13fb Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 13 May 2014 16:09:13 -0700 Subject: Fix for BUG 473: UHD: DBSRX2 VCO Autoselect Failing / Wrong Frequency Range - Corrected frequency range for DBSRX2 - Corrected register write order when changing frequency --- host/lib/usrp/dboard/db_dbsrx2.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 8a8f61a69..d4d1e8de1 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -40,7 +40,7 @@ using namespace boost::assign; /*********************************************************************** * The DBSRX2 constants **********************************************************************/ -static const freq_range_t dbsrx2_freq_range(0.8e9, 2.4e9); +static const freq_range_t dbsrx2_freq_range(0.8e9, 2.3e9); //Multiplied by 2.0 for conversion to complex bandpass from lowpass static const freq_range_t dbsrx2_bandwidth_range(2.0*4.0e6, 2.0*40.0e6); @@ -245,7 +245,7 @@ double dbsrx2::set_lo_freq(double target_freq){ //target_freq = dbsrx2_freq_range.clip(target_freq); //variables used in the calculation below - int scaler = target_freq > 1125e6 ? 2 : 4; + int scaler = target_freq >= 1125e6 ? 2 : 4; double ref_freq = this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX); int R, intdiv, fracdiv, ext_div; double N; @@ -280,7 +280,8 @@ double dbsrx2::set_lo_freq(double target_freq){ << std::endl; //send the registers - send_reg(0x0, 0x7); + send_reg(0x5, 0x7); + send_reg(0x0, 0x4); //FIXME: probably unnecessary to call get_locked here //get_locked(); -- cgit v1.2.3 From e5bb95ca605cf4a3abe1926954c4952a22a2ee7e Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 16 May 2014 15:50:14 -0700 Subject: Fix for BUG 456: LED TX/RX colors backwards on X300 - Corrected bit masks so TX will light the red LED and RX will light the green LED --- host/lib/usrp/x300/x300_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index e931b7983..698d98f55 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1321,8 +1321,8 @@ void x300_impl::update_atr_leds(gpio_core_200_32wo::sptr leds, const std::string { const bool is_txrx = (rx_ant == "TX/RX"); const int rx_led = (1 << 2); - const int txrx_led = (1 << 1); - const int tx_led = (1 << 0); + const int tx_led = (1 << 1); + const int txrx_led = (1 << 0); leds->set_atr_reg(dboard_iface::ATR_REG_IDLE, 0); leds->set_atr_reg(dboard_iface::ATR_REG_RX_ONLY, is_txrx? txrx_led : rx_led); leds->set_atr_reg(dboard_iface::ATR_REG_TX_ONLY, tx_led); -- cgit v1.2.3 From ab5aa84557a79ff537844f25226b22c0459f7348 Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 20 May 2014 11:53:01 -0700 Subject: Fixed whitespace and added comment. --- host/lib/usrp/dboard/db_dbsrx2.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index d4d1e8de1..1debe3c8f 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -279,9 +279,10 @@ double dbsrx2::set_lo_freq(double target_freq){ << boost::format(" Actual Freq=%fMHz\n") % (_lo_freq/1e6) << std::endl; - //send the registers - send_reg(0x5, 0x7); - send_reg(0x0, 0x4); + //send the registers 0x0 through 0x7 + //writing register 0x4 (F divider LSB) starts the VCO auto seletion so it must be written last + send_reg(0x5, 0x7); + send_reg(0x0, 0x4); //FIXME: probably unnecessary to call get_locked here //get_locked(); @@ -305,7 +306,7 @@ static int gain_to_bbg_vga_reg(double &gain){ UHD_LOGV(often) << boost::format("DBSRX2 BBG Gain:\n") - << boost::format(" %f dB, bbg: %d") % gain % reg + << boost::format(" %f dB, bbg: %d") % gain % reg << std::endl; return reg; @@ -330,7 +331,7 @@ static double gain_to_gc1_rfvga_dac(double &gain){ UHD_LOGV(often) << boost::format("DBSRX2 GC1 Gain:\n") - << boost::format(" %f dB, dac_volts: %f V") % gain % dac_volts + << boost::format(" %f dB, dac_volts: %f V") % gain % dac_volts << std::endl; //the actual gain setting -- cgit v1.2.3 From 054a752bb25f9e17c1269b28ad2a95865c0d63a2 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Tue, 20 May 2014 14:33:55 -0700 Subject: x300: adding include to fix builds on older systems --- host/lib/usrp/x300/x300_regs.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/host/lib/usrp/x300/x300_regs.hpp b/host/lib/usrp/x300/x300_regs.hpp index cf1e33695..d4610499a 100644 --- a/host/lib/usrp/x300/x300_regs.hpp +++ b/host/lib/usrp/x300/x300_regs.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_X300_REGS_HPP #define INCLUDED_X300_REGS_HPP +#include #include #define TOREG(x) ((x)*4) -- cgit v1.2.3