From 8142f30e890264dc4dd18c0af72dc885b084da03 Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Wed, 21 Jan 2015 11:32:59 -0800 Subject: b200: Bugfix#672: Enable the correct half-bands - The control bits for the small and the large half-bands were swapped which would cause the large HB to run too fast. Swapped hb0 and hb1 bits to fix the issue. --- host/lib/usrp/cores/rx_dsp_core_3000.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp index 32866880f..13d69920a 100644 --- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp @@ -138,7 +138,7 @@ public: } if (_is_b200) { - _iface->poke32(REG_DSP_RX_DECIM, (hb1 << 9) | (hb0 << 8) | (decim & 0xff)); + _iface->poke32(REG_DSP_RX_DECIM, (hb0 << 9) /*small HB */ | (hb1 << 8) /*large HB*/ | (decim & 0xff)); if (decim > 1 and hb0 == 0 and hb1 == 0) { UHD_MSG(warning) << boost::format( -- cgit v1.2.3 From 38164fb54d0116abf8df4eb2e2df9c1a892c64af Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 19 Jan 2015 09:50:08 +0100 Subject: ad9361: More check for interpolation/decim ratios --- .../lib/usrp/common/ad9361_driver/ad9361_device.cpp | 21 +++++++++++++++------ host/lib/usrp/common/ad9361_driver/ad9361_device.h | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index 7e574920a..afaa4a1fb 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -143,22 +143,25 @@ void ad9361_device_t::_program_fir_filter(direction_t direction, int num_taps, b /* Program the RX FIR Filter. */ -void ad9361_device_t::_setup_rx_fir(size_t num_taps, boost::int32_t interpolation) +void ad9361_device_t::_setup_rx_fir(size_t num_taps, boost::int32_t decimation) { + if (not (decimation == 1 or decimation == 2 or decimation == 4)) { + throw uhd::runtime_error("[ad9361_device_t] Invalid Rx FIR decimation."); + } boost::scoped_array coeffs(new boost::uint16_t[num_taps]); for (size_t i = 0; i < num_taps; i++) { switch (num_taps) { case 128: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); + coeffs[i] = boost::uint16_t((decimation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); break; case 96: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); + coeffs[i] = boost::uint16_t((decimation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); break; case 64: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); + coeffs[i] = boost::uint16_t((decimation==4) ? fir_64_x4_coeffs[i] : hb63_coeffs[i]); break; case 48: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); + coeffs[i] = boost::uint16_t((decimation==4) ? fir_48_x4_coeffs[i] : hb47_coeffs[i]); break; default: throw uhd::runtime_error("[ad9361_device_t] Unsupported number of Rx FIR taps."); @@ -171,11 +174,17 @@ void ad9361_device_t::_setup_rx_fir(size_t num_taps, boost::int32_t interpolatio /* Program the TX FIR Filter. */ void ad9361_device_t::_setup_tx_fir(size_t num_taps, boost::int32_t interpolation) { + if (not (interpolation == 1 or interpolation == 2 or interpolation == 4)) { + throw uhd::runtime_error("[ad9361_device_t] Invalid Tx FIR interpolation."); + } + if (interpolation == 1 and num_t > 64) { + throw uhd::runtime_error("[ad9361_device_t] Too many Tx FIR taps for interpolation value."); + } boost::scoped_array coeffs(new boost::uint16_t[num_taps]); for (size_t i = 0; i < num_taps; i++) { switch (num_taps) { case 128: - coeffs[i] = boost::uint16_t((interpolation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); + coeffs[i] = boost::uint16_t((interpolation==4) ? fir_128_x4_coeffs[i] : hb127_coeffs[i]); break; case 96: coeffs[i] = boost::uint16_t((interpolation==4) ? fir_96_x4_coeffs[i] : hb95_coeffs[i]); diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.h b/host/lib/usrp/common/ad9361_driver/ad9361_device.h index fead90424..ca83f3037 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.h @@ -74,7 +74,7 @@ public: private: //Methods void _program_fir_filter(direction_t direction, int num_taps, boost::uint16_t *coeffs); void _setup_tx_fir(size_t num_taps, boost::int32_t interpolation); - void _setup_rx_fir(size_t num_taps, boost::int32_t interpolation); + void _setup_rx_fir(size_t num_taps, boost::int32_t decimation); void _calibrate_lock_bbpll(); void _calibrate_synth_charge_pumps(); double _calibrate_baseband_rx_analog_filter(); -- cgit v1.2.3 From 3807f816068abca5dbe0ca6c54a251dea270a11a Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Fri, 23 Jan 2015 10:17:20 -0800 Subject: fixup! ad9361: More check for interpolation/decim ratios --- host/lib/usrp/common/ad9361_driver/ad9361_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index afaa4a1fb..3ce655c9b 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -177,7 +177,7 @@ void ad9361_device_t::_setup_tx_fir(size_t num_taps, boost::int32_t interpolatio if (not (interpolation == 1 or interpolation == 2 or interpolation == 4)) { throw uhd::runtime_error("[ad9361_device_t] Invalid Tx FIR interpolation."); } - if (interpolation == 1 and num_t > 64) { + if (interpolation == 1 and num_taps > 64) { throw uhd::runtime_error("[ad9361_device_t] Too many Tx FIR taps for interpolation value."); } boost::scoped_array coeffs(new boost::uint16_t[num_taps]); -- cgit v1.2.3