aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.cpp27
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.hpp29
-rw-r--r--host/lib/usrp/dboard/db_ubx.cpp16
3 files changed, 51 insertions, 21 deletions
diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp
index 8df4028e7..42c080155 100644
--- a/host/lib/usrp/dboard/db_sbx_common.cpp
+++ b/host/lib/usrp/dboard/db_sbx_common.cpp
@@ -118,27 +118,24 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){
switch(get_rx_id().to_uint16()) {
case 0x0054:
db_actual = sbx_versionx_sptr(new sbx_version3(this));
- freq_range = sbx_freq_range;
+ freq_range = sbx_freq_range;
+ enable_rx_lo_filter = sbx_enable_rx_lo_filter;
+ enable_tx_lo_filter = sbx_enable_tx_lo_filter;
break;
case 0x0065:
- db_actual = sbx_versionx_sptr(new sbx_version4(this));
- freq_range = sbx_freq_range;
- break;
- case 0x0067:
- db_actual = sbx_versionx_sptr(new cbx(this));
- freq_range = cbx_freq_range;
- break;
case 0x0069:
- db_actual = sbx_versionx_sptr(new sbx_version4(this));
- freq_range = sbx_freq_range;
- break;
case 0x0083:
db_actual = sbx_versionx_sptr(new sbx_version4(this));
- freq_range = sbx_freq_range;
+ freq_range = sbx_freq_range;
+ enable_rx_lo_filter = sbx_enable_rx_lo_filter;
+ enable_tx_lo_filter = sbx_enable_tx_lo_filter;
break;
+ case 0x0067:
case 0x0085:
db_actual = sbx_versionx_sptr(new cbx(this));
- freq_range = cbx_freq_range;
+ freq_range = cbx_freq_range;
+ enable_rx_lo_filter = cbx_enable_rx_lo_filter;
+ enable_tx_lo_filter = cbx_enable_tx_lo_filter;
break;
default:
/* We didn't recognize the version of the board... */
@@ -256,8 +253,8 @@ void sbx_xcvr::update_atr(void){
//calculate atr pins
int rx_pga0_iobits = rx_pga0_gain_to_iobits(_rx_gains["PGA0"]);
int tx_pga0_iobits = tx_pga0_gain_to_iobits(_tx_gains["PGA0"]);
- int rx_lo_lpf_en = (_rx_lo_freq == sbx_enable_rx_lo_filter.clip(_rx_lo_freq)) ? LO_LPF_EN : 0;
- int tx_lo_lpf_en = (_tx_lo_freq == sbx_enable_tx_lo_filter.clip(_tx_lo_freq)) ? LO_LPF_EN : 0;
+ int rx_lo_lpf_en = (_rx_lo_freq == enable_rx_lo_filter.clip(_rx_lo_freq)) ? LO_LPF_EN : 0;
+ int tx_lo_lpf_en = (_tx_lo_freq == enable_tx_lo_filter.clip(_tx_lo_freq)) ? LO_LPF_EN : 0;
int rx_ld_led = _rx_lo_lock_cache ? 0 : RX_LED_LD;
int tx_ld_led = _tx_lo_lock_cache ? 0 : TX_LED_LD;
int rx_ant_led = _rx_ant == "TX/RX" ? RX_LED_RX1RX2 : 0;
diff --git a/host/lib/usrp/dboard/db_sbx_common.hpp b/host/lib/usrp/dboard/db_sbx_common.hpp
index 0e4dc5ace..8f305a7c4 100644
--- a/host/lib/usrp/dboard/db_sbx_common.hpp
+++ b/host/lib/usrp/dboard/db_sbx_common.hpp
@@ -116,6 +116,14 @@ static const freq_range_t sbx_enable_rx_lo_filter = list_of
(range_t(0.4e9, 1.5e9))
;
+static const freq_range_t cbx_enable_tx_lo_filter = list_of
+ (range_t(1.2e9, 2e9))
+;
+
+static const freq_range_t cbx_enable_rx_lo_filter = list_of
+ (range_t(1.2e9, 2e9))
+;
+
static const std::vector<std::string> sbx_tx_antennas = list_of("TX/RX")("CAL");
static const std::vector<std::string> sbx_rx_antennas = list_of("TX/RX")("RX2")("CAL");
@@ -226,9 +234,12 @@ protected:
/*!
* CBX daughterboard
*
- * The only driver difference between SBX and CBX is the MAX2870 vs. ADF435x.
- * There is also no LO filter switching required, but the GPIO is left blank
- * so we don't worry about it.
+ * There are a few differences between SBX and CBX
+ * - The CBX and SBX use the MAX2870 and ADF435x respectively for LOs
+ * - There are different frequency ranges
+ * - There are different LO LPF cutoff frequencies
+ * There is also no LO filter switching required on CBX, but the GPIO is left
+ * blank so we don't worry about it.
*/
class cbx : public sbx_versionx {
public:
@@ -252,6 +263,18 @@ protected:
freq_range_t freq_range;
/*!
+ * Frequency range to use the LO LPF in RX; this is set in the constructor
+ * to correspond either to SBX or CBX.
+ */
+ freq_range_t enable_rx_lo_filter;
+
+ /*!
+ * Frequency range to use the LO LPF in TX; this is set in the constructor
+ * to correspond either to SBX or CBX.
+ */
+ freq_range_t enable_tx_lo_filter;
+
+ /*!
* Handle to the version-specific implementation of the SBX.
*
* Since many of this class's functions are dependent on the version of the
diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp
index d25aabe98..21308b08c 100644
--- a/host/lib/usrp/dboard/db_ubx.cpp
+++ b/host/lib/usrp/dboard/db_ubx.cpp
@@ -295,6 +295,7 @@ public:
_tx_target_pfd_freq = pfd_freq_max;
if (_rev >= 1)
{
+ bool can_set_clock_rate = true;
// set dboard clock rates to as close to the max PFD freq as possible
if (_iface->get_clock_rate(dboard_iface::UNIT_RX) > pfd_freq_max)
{
@@ -305,10 +306,15 @@ public:
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
}
- _iface->set_clock_rate(dboard_iface::UNIT_RX, highest_rate);
+ try {
+ _iface->set_clock_rate(dboard_iface::UNIT_RX, highest_rate);
+ } catch (const uhd::not_implemented_error &) {
+ UHD_MSG(warning) << "Unable to set dboard clock rate - phase will vary" << std::endl;
+ can_set_clock_rate = false;
+ }
_rx_target_pfd_freq = highest_rate;
}
- if (_iface->get_clock_rate(dboard_iface::UNIT_TX) > pfd_freq_max)
+ if (can_set_clock_rate and _iface->get_clock_rate(dboard_iface::UNIT_TX) > pfd_freq_max)
{
std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_TX);
double highest_rate = 0.0;
@@ -317,7 +323,11 @@ public:
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
}
- _iface->set_clock_rate(dboard_iface::UNIT_TX, highest_rate);
+ try {
+ _iface->set_clock_rate(dboard_iface::UNIT_TX, highest_rate);
+ } catch (const uhd::not_implemented_error &) {
+ UHD_MSG(warning) << "Unable to set dboard clock rate - phase will vary" << std::endl;
+ }
_tx_target_pfd_freq = highest_rate;
}
}