From aa4a6b6686967d39bd2f295c7170dc196abd68e6 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Fri, 27 Aug 2010 15:22:55 -0700 Subject: Created pps_test example and docs --- host/docs/usrp2.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'host/docs') diff --git a/host/docs/usrp2.rst b/host/docs/usrp2.rst index 3ac326f58..0d48209be 100644 --- a/host/docs/usrp2.rst +++ b/host/docs/usrp2.rst @@ -205,3 +205,18 @@ Example, set the args string to the following: :: addr=192.168.10.2, recv_buff_size=100e6 + +------------------------------------------------------------------------ +Hardware setup notes +------------------------------------------------------------------------ + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Ref Clock - 10MHz +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Using an external 10MHz reference clock requires a signal level between +5dBm and +20dBm at 10MHz applied to the Ref Clock SMA port on the front panel. + + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +PPS - Pulse Per Second +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Using a PPS signal for timestamp synchronization requires a 5Vpp square wave signal -- cgit v1.2.3 From f5c62a46cbc44e254c0214b463d51f06675c17ab Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 16:54:18 -0700 Subject: usrp1: subdev spec tweaks and docs --- host/docs/usrp1.rst | 35 +++++++++++++++++++++++++++++++++++ host/include/uhd/usrp/subdev_spec.hpp | 9 --------- host/lib/usrp/misc_utils.cpp | 13 +++++++++++-- 3 files changed, 46 insertions(+), 11 deletions(-) (limited to 'host/docs') diff --git a/host/docs/usrp1.rst b/host/docs/usrp1.rst index ebc33cbfa..c960b928b 100644 --- a/host/docs/usrp1.rst +++ b/host/docs/usrp1.rst @@ -21,6 +21,41 @@ Change the USRP1's serial number ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO +------------------------------------------------------------------------ +Specifying the subdevice to use +------------------------------------------------------------------------ +The USRP1 has multiple daughterboard slots, known as slot A and slot B. +The subdevice specification can be used to select +the daughterboard and subdevice for each channel. +For daughterboards with one one subdevice, +the subdevice name may be left blank for automatic selection. + +Ex: The subdev spec markup string to select a WBX on slot B. +Notice the use of the blank subdevice name for automatic selection. + +:: + + B: + + -- OR -- + + B:0 + +Ex: The subdev spec markup string to select a BasicRX on slot B. +Notice that the subdevice name is always specified in the 3 possible cases. + +:: + + B:AB + + -- OR -- + + B:A + + -- OR -- + + B:B + ------------------------------------------------------------------------ OS Specific Notes ------------------------------------------------------------------------ diff --git a/host/include/uhd/usrp/subdev_spec.hpp b/host/include/uhd/usrp/subdev_spec.hpp index 56aa0df20..2f32509b9 100644 --- a/host/include/uhd/usrp/subdev_spec.hpp +++ b/host/include/uhd/usrp/subdev_spec.hpp @@ -56,17 +56,8 @@ namespace uhd{ namespace usrp{ * * The subdevice specification can be represented as a markup-string. * The markup-string is a whitespace separated list of dboard:subdev pairs. - * The "dboard:" part is optional on boards with only one daughterboard slot. * The first pair represents the subdevice for channel zero, * the second pair represents the subdevice for channel one, and so on. - * - * Examples: - * - Use subdevice AB on daughterboard A (USRP1): "A:AB" - * - Use subdevice A on daughterboard A for channel zero and subdevice A on daughterboard B for channel one (USRP1): "A:A B:A" - * - Use subdevice AB (USRP2): "AB" or ":AB" - * - * An empty subdevice specification can be used to automatically - * select the first subdevice on the first present daughterboard. */ class UHD_API subdev_spec_t : public std::vector{ public: diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index a1664d810..5cfcdc8d3 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -164,13 +164,22 @@ static void verify_xx_subdev_spec( //empty db name means select dboard automatically if (pair.db_name.empty()){ if (dboard_names.size() != 1) throw std::runtime_error( - "A daughterboard name must be provided for multi-slot boards: " + subdev_spec.to_string() + "A daughterboard name must be provided for multi-slot motherboards: " + subdev_spec.to_string() ); pair.db_name == dboard_names.front(); } uhd::assert_has(dboard_names, pair.db_name, xx_type + " dboard name"); wax::obj dboard = mboard[named_prop_t(dboard_prop, pair.db_name)]; - uhd::assert_has(dboard[DBOARD_PROP_SUBDEV_NAMES].as(), pair.sd_name, xx_type + " subdev name"); + prop_names_t subdev_names = dboard[DBOARD_PROP_SUBDEV_NAMES].as(); + + //empty sd name means select the subdev automatically + if (pair.sd_name.empty()){ + if (subdev_names.size() != 1) throw std::runtime_error( + "A subdevice name must be provided for multi-subdev daughterboards: " + subdev_spec.to_string() + ); + pair.sd_name == subdev_names.front(); + } + uhd::assert_has(subdev_names, pair.sd_name, xx_type + " subdev name"); } }catch(const std::exception &e){ throw std::runtime_error(str(boost::format( -- cgit v1.2.3 From af0543a8b72e924c26503d838976e249d8ca6fbb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 18:42:45 -0700 Subject: usrp1: work on gpio clock divider for dbsrx, still not locking --- host/docs/build.rst | 8 ++++++++ host/lib/usrp/dboard/db_dbsrx.cpp | 7 ++++++- host/lib/usrp/usrp1/dboard_iface.cpp | 12 ++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'host/docs') diff --git a/host/docs/build.rst b/host/docs/build.rst index 8f0d0db59..d7dfd05e5 100644 --- a/host/docs/build.rst +++ b/host/docs/build.rst @@ -52,6 +52,14 @@ Boost * **Download URL:** http://www.boost.org/users/download/ * **Download URL (windows installer):** http://www.boostpro.com/download +^^^^^^^^^^^^^^^^ +LibUSB +^^^^^^^^^^^^^^^^ +* **Purpose:** USB userspace library +* **Version:** at least 1.0 +* **Required for:** build time + run time (optional) +* **Download URL:** http://www.libusb.org/ + ^^^^^^^^^^^^^^^^ Python ^^^^^^^^^^^^^^^^ diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index 06cf91d3b..81434f054 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -205,7 +205,12 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){ //set the gpio directions and atr controls (identically) this->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, 0x0); // All unused in atr - this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, 0x0); // All Inputs + if (this->get_iface()->get_special_props().soft_clock_divider){ + this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, 0x1); // GPIO0 is clock + } + else{ + this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, 0x0); // All Inputs + } //send initial register settings this->send_reg(0x0, 0x5); diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index b2221e221..454de3ece 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -49,8 +49,8 @@ public: _codec = codec; //init the clock rate shadows - this->set_clock_rate(UNIT_RX, _clock->get_master_clock_freq()); - this->set_clock_rate(UNIT_TX, _clock->get_master_clock_freq()); + this->set_clock_rate(UNIT_RX, this->get_clock_rates(UNIT_RX).front()); + this->set_clock_rate(UNIT_TX, this->get_clock_rates(UNIT_TX).front()); } ~usrp1_dboard_iface() @@ -134,14 +134,14 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate) _clock_rates[unit] = rate; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - size_t divider = size_t(rate/_clock->get_master_clock_freq()); + size_t divider = size_t(_clock->get_master_clock_freq()/rate); switch(_dboard_slot){ case usrp1_impl::DBOARD_SLOT_A: - _iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_A_REFCLK, (2*divider & 0x7f) | 0x80); break; case usrp1_impl::DBOARD_SLOT_B: - _iface->poke32(FR_RX_B_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_B_REFCLK, (2*divider & 0x7f) | 0x80); break; } } @@ -151,7 +151,7 @@ std::vector usrp1_dboard_iface::get_clock_rates(unit_t unit) { std::vector rates; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - for (size_t div = 1; div <= 127; div++) + for (size_t div = 8; div <= 127; div++) rates.push_back(_clock->get_master_clock_freq() / div); } else{ -- cgit v1.2.3