aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/docs/dboards.rst9
-rw-r--r--host/examples/test_async_messages.cpp8
-rw-r--r--host/include/uhd/usrp/mimo_usrp.hpp2
-rw-r--r--host/include/uhd/usrp/simple_usrp.hpp2
-rw-r--r--host/include/uhd/usrp/single_usrp.hpp2
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp22
-rw-r--r--host/lib/usrp/dboard/db_tvrx.cpp6
-rw-r--r--host/lib/usrp/mimo_usrp.cpp4
-rw-r--r--host/lib/usrp/simple_usrp.cpp4
-rw-r--r--host/lib/usrp/single_usrp.cpp4
10 files changed, 45 insertions, 18 deletions
diff --git a/host/docs/dboards.rst b/host/docs/dboards.rst
index 738a0696d..4ad724c82 100644
--- a/host/docs/dboards.rst
+++ b/host/docs/dboards.rst
@@ -107,6 +107,15 @@ Transmit Gains: **PGA0**, Range: 0-25dB
Recieve Gains: **PGA0**, Range: 0-31.5dB
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+TVRX
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Receive Antennas: RX
+
+Receive Gains:
+ * **RF**, Range: -13.3-50.3dB (frequency-dependent)
+ * **IF**, Range: -1.5-32.5dB
+
------------------------------------------------------------------------
Daughterboard Modifications
------------------------------------------------------------------------
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp
index 0a5c076ea..e4a996ef5 100644
--- a/host/examples/test_async_messages.cpp
+++ b/host/examples/test_async_messages.cpp
@@ -26,8 +26,6 @@
namespace po = boost::program_options;
-static const size_t async_to_ms = 100;
-
/*!
* Test that no messages are received:
* Send a burst of many samples that will fragment internally.
@@ -52,7 +50,7 @@ void test_no_async_message(uhd::usrp::single_usrp::sptr sdev){
);
uhd::async_metadata_t async_md;
- if (dev->recv_async_msg(async_md, async_to_ms)){
+ if (dev->recv_async_msg(async_md)){
std::cout << boost::format(
"failed:\n"
" Got unexpected event code 0x%x.\n"
@@ -88,7 +86,7 @@ void test_underflow_message(uhd::usrp::single_usrp::sptr sdev){
);
uhd::async_metadata_t async_md;
- if (not dev->recv_async_msg(async_md, async_to_ms)){
+ if (not dev->recv_async_msg(async_md)){
std::cout << boost::format(
"failed:\n"
" Async message recv timed out.\n"
@@ -135,7 +133,7 @@ void test_time_error_message(uhd::usrp::single_usrp::sptr sdev){
);
uhd::async_metadata_t async_md;
- if (not dev->recv_async_msg(async_md, async_to_ms)){
+ if (not dev->recv_async_msg(async_md)){
std::cout << boost::format(
"failed:\n"
" Async message recv timed out.\n"
diff --git a/host/include/uhd/usrp/mimo_usrp.hpp b/host/include/uhd/usrp/mimo_usrp.hpp
index 10a404059..bdd84a148 100644
--- a/host/include/uhd/usrp/mimo_usrp.hpp
+++ b/host/include/uhd/usrp/mimo_usrp.hpp
@@ -148,6 +148,8 @@ public:
* \return the rssi in dB
*/
virtual float read_rssi(size_t chan) = 0;
+
+ virtual void set_rx_bandwidth(size_t chan, float bandwidth) = 0;
/*******************************************************************
* TX methods
diff --git a/host/include/uhd/usrp/simple_usrp.hpp b/host/include/uhd/usrp/simple_usrp.hpp
index 6149f739c..6f3597ed7 100644
--- a/host/include/uhd/usrp/simple_usrp.hpp
+++ b/host/include/uhd/usrp/simple_usrp.hpp
@@ -139,6 +139,8 @@ public:
virtual float read_rssi(void) = 0;
virtual dboard_iface::sptr get_rx_dboard_iface(void) = 0;
+
+ virtual void set_rx_bandwidth(float) = 0;
/*******************************************************************
* TX methods
diff --git a/host/include/uhd/usrp/single_usrp.hpp b/host/include/uhd/usrp/single_usrp.hpp
index 3cd263bce..fa6498d13 100644
--- a/host/include/uhd/usrp/single_usrp.hpp
+++ b/host/include/uhd/usrp/single_usrp.hpp
@@ -152,6 +152,8 @@ public:
virtual float read_rssi(size_t chan = 0) = 0;
virtual dboard_iface::sptr get_rx_dboard_iface(size_t chan = 0) = 0;
+
+ virtual void set_rx_bandwidth(float bandwidth, size_t chan = 0) = 0;
/*******************************************************************
* TX methods
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 23cafea53..99137dda3 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -239,7 +239,6 @@ void dbsrx::set_lo_freq(double target_freq){
double actual_freq=0.0, pfd_freq=0.0, ref_clock=0.0;
int R=0, N=0, r=0, m=0;
bool update_filter_settings = false;
-
//choose refclock
std::vector<double> clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX);
BOOST_FOREACH(ref_clock, std::reversed(std::sorted(clock_rates))){
@@ -251,7 +250,7 @@ void dbsrx::set_lo_freq(double target_freq){
if(dbsrx_debug) std::cerr << boost::format(
"DBSRX: trying ref_clock %f and m_divider %d"
- ) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % m << std::endl;
+ ) % (ref_clock) % m << std::endl;
if (m >= 32) continue;
@@ -277,15 +276,17 @@ void dbsrx::set_lo_freq(double target_freq){
}
}
- //Assert because we failed to find a suitable combination of ref_clock, R and N
- UHD_ASSERT_THROW(ref_clock/(1 << m) < 1e6 or ref_clock/(1 << m) > 2.5e6);
- UHD_ASSERT_THROW((pfd_freq < dbsrx_pfd_freq_range.min) or (pfd_freq > dbsrx_pfd_freq_range.max));
- UHD_ASSERT_THROW((N < 256) or (N > 32768));
done_loop:
+ //Assert because we failed to find a suitable combination of ref_clock, R and N
+ UHD_ASSERT_THROW(ref_clock <= 27.0e6 and ref_clock >= 0.0);
+ UHD_ASSERT_THROW(ref_clock/m >= 1e6 and ref_clock/m <= 2.5e6);
+ UHD_ASSERT_THROW((pfd_freq >= dbsrx_pfd_freq_range.min) and (pfd_freq <= dbsrx_pfd_freq_range.max));
+ UHD_ASSERT_THROW((N >= 256) and (N <= 32768));
+
if(dbsrx_debug) std::cerr << boost::format(
- "DBSRX: choose ref_clock %f and m_divider %d"
- ) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % m << std::endl;
+ "DBSRX: choose ref_clock (current: %f, new: %f) and m_divider %d"
+ ) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % ref_clock % m << std::endl;
//if ref_clock or m divider changed, we need to update the filter settings
if (ref_clock != this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX) or m != _max2118_write_regs.m_divider) update_filter_settings = true;
@@ -349,7 +350,7 @@ void dbsrx::set_lo_freq(double target_freq){
"DBSRX: Tuning exceeded vco range, _max2118_write_regs.osc_band == %d\n"
) % int(_max2118_write_regs.osc_band))
);
- UHD_ASSERT_THROW(_max2118_read_regs.adc == 0);
+ UHD_ASSERT_THROW(_max2118_read_regs.adc != 0); //just to cause a throw
}
if (_max2118_write_regs.osc_band <= 0) break;
_max2118_write_regs.osc_band -= 1;
@@ -363,7 +364,7 @@ void dbsrx::set_lo_freq(double target_freq){
"DBSRX: Tuning exceeded vco range, _max2118_write_regs.osc_band == %d\n"
) % int(_max2118_write_regs.osc_band))
);
- UHD_ASSERT_THROW(_max2118_read_regs.adc == 0);
+ UHD_ASSERT_THROW(_max2118_read_regs.adc != 7); //just to cause a throw
}
if (_max2118_write_regs.osc_band >= 7) break;
_max2118_write_regs.osc_band += 1;
@@ -401,6 +402,7 @@ void dbsrx::set_lo_freq(double target_freq){
<< boost::format(" Ref Freq=%fMHz\n") % (ref_clock/1e6)
<< boost::format(" Target Freq=%fMHz\n") % (target_freq/1e6)
<< boost::format(" Actual Freq=%fMHz\n") % (_lo_freq/1e6)
+ << boost::format(" VCO Freq=%fMHz\n") % (vco_freq/1e6)
<< std::endl;
if (update_filter_settings) set_bandwidth(_bandwidth);
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp
index b1fc2ea76..10be8d1c3 100644
--- a/host/lib/usrp/dboard/db_tvrx.cpp
+++ b/host/lib/usrp/dboard/db_tvrx.cpp
@@ -58,7 +58,7 @@ static const bool tvrx_debug = false;
static const freq_range_t tvrx_freq_range(50e6, 860e6);
-static const prop_names_t tvrx_antennas = list_of(""); //only got one
+static const prop_names_t tvrx_antennas = list_of("RX");
static const uhd::dict<std::string, freq_range_t> tvrx_freq_ranges = map_list_of
("VHFLO", freq_range_t(50e6, 158e6))
@@ -73,7 +73,7 @@ static const boost::array<double, 17> vhflo_gains_db =
50.30000, 50.30000}};
static const boost::array<double, 17> vhfhi_gains_db =
- {{13.3000, -13.3000, -13.3000, -1.0000, 7.7000,
+ {{-13.3000, -13.3000, -13.3000, -1.0000, 7.7000,
11.0000, 14.7000, 19.3000, 26.1000, 36.0000,
42.7000, 46.0000, 47.0000, 47.8000, 48.2000,
48.2000, 48.2000}};
@@ -436,7 +436,7 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_ANTENNA:
- val = std::string("");
+ val = tvrx_antennas.front(); //there's only one
return;
case SUBDEV_PROP_ANTENNA_NAMES:
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp
index 9331c7fbb..08618c288 100644
--- a/host/lib/usrp/mimo_usrp.cpp
+++ b/host/lib/usrp/mimo_usrp.cpp
@@ -225,6 +225,10 @@ public:
float read_rssi(size_t chan){
return _rx_subdev(chan)[SUBDEV_PROP_RSSI].as<float>();
}
+
+ void set_rx_bandwidth(size_t chan, float bandwidth){
+ _rx_subdev(chan)[SUBDEV_PROP_BANDWIDTH] = bandwidth;
+ }
/*******************************************************************
* TX methods
diff --git a/host/lib/usrp/simple_usrp.cpp b/host/lib/usrp/simple_usrp.cpp
index b89b76eed..b4f34287b 100644
--- a/host/lib/usrp/simple_usrp.cpp
+++ b/host/lib/usrp/simple_usrp.cpp
@@ -136,6 +136,10 @@ public:
dboard_iface::sptr get_rx_dboard_iface(void){
return _sdev->get_rx_dboard_iface();
}
+
+ void set_rx_bandwidth(float bandwidth) {
+ return _sdev->set_rx_bandwidth(bandwidth);
+ }
/*******************************************************************
* TX methods
diff --git a/host/lib/usrp/single_usrp.cpp b/host/lib/usrp/single_usrp.cpp
index 08dc3bb1d..7d053535e 100644
--- a/host/lib/usrp/single_usrp.cpp
+++ b/host/lib/usrp/single_usrp.cpp
@@ -202,6 +202,10 @@ public:
dboard_iface::sptr get_rx_dboard_iface(size_t chan){
return _rx_dboard(chan)[DBOARD_PROP_DBOARD_IFACE].as<dboard_iface::sptr>();
}
+
+ void set_rx_bandwidth(float bandwidth, size_t chan) {
+ _rx_subdev(chan)[SUBDEV_PROP_BANDWIDTH] = bandwidth;
+ }
/*******************************************************************
* TX methods