Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions host/docs/devices/usrp_b200.dox
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@ The TX path and the two RX paths have their own calibration data, resulting in
Devices have to be manually calibrated using a calibrated power meter or
signal generator.

\subsection b200_fe_sensors Frontend sensors

Each receive frontend provides these sensors, read with
uhd::usrp::multi_usrp::get_rx_sensor():

- `lo_locked`: True if the RX LO is locked.
- `rssi`: RSSI value as returned from the AD9361, in dB.
- `temp`: Temperature of the AD9361, in degrees Celsius.
- `overload`: Integer with the RX overload signals of the AD9361 for this
chain (registers 0x2B8 and 0x2B9): bit 4 large LMT overload, bit 3 small
LMT overload, bit 2 large ADC overload, bit 1 small ADC overload, bit 0
digital saturation. The LMT bits detect an overload of the RF front end,
which can be caused by a strong signal outside the captured band and does
not show as clipped samples. The bits stay set until the next gain change.

\section b200_hw_ref Hardware Reference

\subsection b200_hw_ref_leds LED Indicators
Expand Down
6 changes: 6 additions & 0 deletions host/lib/include/uhdlib/usrp/common/ad9361_ctrl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class ad9361_ctrl : public uhd::noncopyable
//! read internal RSSI sensor
virtual sensor_value_t get_rssi(const std::string& which) = 0;

//! read the RX overload signals (LMT, ADC, digital saturation)
virtual sensor_value_t get_overload(const std::string& which)
{
throw uhd::not_implemented_error("get_overload: " + which);
}

//! read the internal temp sensor
virtual sensor_value_t get_temperature() = 0;

Expand Down
10 changes: 10 additions & 0 deletions host/lib/usrp/common/ad9361_ctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ class ad9361_ctrl_impl : public ad9361_ctrl
return sensor_value_t("RSSI", _device.get_rssi(chain), "dB");
}

//! read the RX overload signals of the chain
sensor_value_t get_overload(const std::string& which) override
{
std::lock_guard<std::mutex> lock(_mutex);

ad9361_device_t::chain_t chain = _get_chain_from_antenna(which);
return sensor_value_t(
"overload", static_cast<int>(_device.get_overload(chain)), "");
}

//! read the internal temp sensor. Average over 3 results
sensor_value_t get_temperature() override
{
Expand Down
6 changes: 6 additions & 0 deletions host/lib/usrp/common/ad9361_driver/ad9361_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,12 @@ double ad9361_device_t::get_rssi(chain_t chain)
return rssi;
}

uint8_t ad9361_device_t::get_overload(chain_t chain)
{
const uint32_t reg = (chain == CHAIN_1) ? 0x2B8 : 0x2B9;
return _io_iface->peek8(reg) & 0x1F;
}

/*
* Returns the reading of the internal temperature sensor.
* One point calibration of the sensor was done according to datasheet
Expand Down
5 changes: 5 additions & 0 deletions host/lib/usrp/common/ad9361_driver/ad9361_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ class ad9361_device_t : public uhd::noncopyable
/* Read back the internal RSSI measurement data. */
double get_rssi(chain_t chain);

/* Read the RX overload signals of a chain (register 0x2B8/0x2B9):
* bit 4 large LMT, 3 small LMT, 2 large ADC, 1 small ADC, 0 digital
* saturation. */
uint8_t get_overload(chain_t chain);

/*! Read the internal temperature sensor
*\param calibrate return raw sensor readings or apply calibration factor.
*\param num_samples number of measurements to average over
Expand Down
4 changes: 4 additions & 0 deletions host/lib/usrp/common/ad936x_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ class ad936x_manager_impl : public ad936x_manager
subtree->create<sensor_value_t>("sensors/rssi").set_publisher([this, key]() {
return this->_codec_ctrl->get_rssi(key);
});
subtree->create<sensor_value_t>("sensors/overload")
.set_publisher([this, key]() {
return this->_codec_ctrl->get_overload(key);
});
}

// Gains
Expand Down
Loading