aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/python/uhd/usrp/cal/usrp_calibrator.py5
-rw-r--r--host/utils/uhd_power_cal.py2
2 files changed, 7 insertions, 0 deletions
diff --git a/host/python/uhd/usrp/cal/usrp_calibrator.py b/host/python/uhd/usrp/cal/usrp_calibrator.py
index bb98e045a..c129fb17d 100644
--- a/host/python/uhd/usrp/cal/usrp_calibrator.py
+++ b/host/python/uhd/usrp/cal/usrp_calibrator.py
@@ -91,6 +91,7 @@ class USRPCalibratorBase:
lo_offset = 0.0
min_freq = None
max_freq = None
+ tune_settling_time = 0
def __init__(self, usrp, meas_dev, direction, **kwargs):
self._usrp = usrp
@@ -200,6 +201,7 @@ class USRPCalibratorBase:
self._noise[freq] = {}
tune_req = uhd.types.TuneRequest(freq)
self._usrp.set_rx_freq(tune_req, self._chan)
+ time.sleep(self.tune_settling_time)
for gain in self._gains:
self._usrp.set_rx_gain(gain, self._chan)
self._noise[freq][gain] = get_usrp_power(self._streamer)
@@ -401,6 +403,9 @@ class X410Calibrator(USRPCalibratorBase):
default_rate = 3.84e6
min_freq = 1e6
max_freq = 8e9
+ # X410 non-timed tunes are currently very poke-intensive, so we give it some
+ # time to clear the command queue
+ tune_settling_time = .5
###############################################################################
# The dispatch function
diff --git a/host/utils/uhd_power_cal.py b/host/utils/uhd_power_cal.py
index b9029cc60..70fcbbde6 100644
--- a/host/utils/uhd_power_cal.py
+++ b/host/utils/uhd_power_cal.py
@@ -9,6 +9,7 @@ Utility to run power calibrations with USRPs
"""
import sys
+import time
import math
import pickle
import argparse
@@ -180,6 +181,7 @@ class CalRunner:
print("=== Running calibration at frequency {:.3f} MHz...".format(freq / 1e6))
tune_req = uhd.types.TuneRequest(freq, self.lo_offset)
getattr(self.usrp, 'set_{}_freq'.format(self.dir))(tune_req, chan)
+ time.sleep(self.usrp_cal.tune_settling_time)
actual_freq = getattr(self.usrp, 'get_{}_freq'.format(self.dir))(chan)
if abs(actual_freq - freq) > 1.0:
print("WARNING: Frequency was coerced from {:.2f} MHz to {:.2f} MHz!"