aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-07-24 09:55:40 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-10 10:16:36 -0700
commit2e838250863eb7f4e0c7d3800174b8ccc8dc2da9 (patch)
tree52f2d0a2aae0da4f0193ff314259917ab697e1bc
parent016136f548220ad7bd5c34b8e25fc740a68aeb08 (diff)
downloaduhd-2e838250863eb7f4e0c7d3800174b8ccc8dc2da9.tar.gz
uhd-2e838250863eb7f4e0c7d3800174b8ccc8dc2da9.tar.bz2
uhd-2e838250863eb7f4e0c7d3800174b8ccc8dc2da9.zip
x300: Enable clock_source and time_source device args
You can now change the time/clock source default through device args: auto usrp = uhd::usrp::multi_usrp::make( "type=x300,clock_source=external,time_source=external"); This also enables the use of config files for the clock/time source implicitly.
-rw-r--r--host/docs/usrp_x3x0.dox15
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp4
2 files changed, 15 insertions, 4 deletions
diff --git a/host/docs/usrp_x3x0.dox b/host/docs/usrp_x3x0.dox
index d76d5eaa0..84ef7bd99 100644
--- a/host/docs/usrp_x3x0.dox
+++ b/host/docs/usrp_x3x0.dox
@@ -616,10 +616,17 @@ Afterward, power-cycle your X-Series device for the changes to take effect.
\subsection x3x0_hw_x3x0_hw_ref10M Ref Clock - 10 MHz
Using an external 10 MHz reference clock, a square wave will offer the best phase
-noise performance, but a sinusoid is acceptable. The power level of the reference clock cannot exceed +15 dBm.
+noise performance, but a sinusoid is acceptable.
+The power level of the reference clock must exceed +15 dBm.
+
+To use the external reference in your UHD session, make sure to either call
+uhd::usrp::multi_usrp::set_clock_source() or specify `clock_source=external` in
+your device args.
\subsection x3x0_hw_pps PPS - Pulse Per Second
-Using a PPS signal for timestamp synchronization requires a square wave signal with the following a 5Vpp amplitude.
+
+Using a PPS signal for timestamp synchronization requires a square wave signal
+with a 5Vpp amplitude.
To test the PPS input, you can use the following tool from the UHD examples:
@@ -628,6 +635,10 @@ To test the PPS input, you can use the following tool from the UHD examples:
cd <install-path>/lib/uhd/examples
./test_pps_input --args=\<args\>
+To use the external time source in your UHD session, make sure to either call
+uhd::usrp::multi_usrp::set_time_source() or specify `time_source=external` in
+your device args.
+
\subsection x3x0_hw_gpsdo Internal GPSDO
Please see \ref page_gpsdo_x3x0 for information on configuring and using the internal GPSDO.
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 22ebdf546..9b0fe9a51 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -981,7 +981,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
// setup time sources and properties
////////////////////////////////////////////////////////////////////
_tree->create<std::string>(mb_path / "time_source" / "value")
- .set("internal")
+ .set(mb.args.get_time_source())
.add_coerced_subscriber([this, &mb](const std::string& time_source){
this->update_time_source(mb, time_source);
})
@@ -1003,7 +1003,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
// setup clock sources and properties
////////////////////////////////////////////////////////////////////
_tree->create<std::string>(mb_path / "clock_source" / "value")
- .set(x300::DEFAULT_TIME_SOURCE)
+ .set(mb.args.get_clock_source())
.add_coerced_subscriber([this, &mb](const std::string& clock_source){
this->update_clock_source(mb, clock_source);
})