From 3e0fb6a5b33c5165766ddaf0c1d046c89db9f86f Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 15 Aug 2007 02:44:48 +0000 Subject: [PATCH] progress git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6135 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-usrp/src/db_wbx.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/gr-usrp/src/db_wbx.py b/gr-usrp/src/db_wbx.py index 53069291..c008d76e 100644 --- a/gr-usrp/src/db_wbx.py +++ b/gr-usrp/src/db_wbx.py @@ -510,9 +510,30 @@ class _lo_common(_ADF410X_common): if(div == divisor): self.aux_div = val - self._u.write_io(self._which, ((self.main_div< 1200e6): + raise ValueError, "Requested frequency out of range" + div = 1 + lo_freq = freq * 2 + while freq < 1e9 and div < 8: + div = div * 2 + lo_freq = lo_freq * 2 + print "For RF freq of %f, we set DIV=%d and LO Freq=%f" % (freq, div, lo_freq) + self.set_divider('main', div) + self.set_divider('aux', 2) + + R, N, control, actual_freq = self._compute_regs(freq) + if R==0: + return(False,0) + self._write_all(R, N, control) + return (self._lock_detect(), actual_freq) + + #------------------------------------------------------------ class db_wbx_lo_tx(_lo_common, wbx_base_tx): def __init__(self, usrp, which): @@ -574,11 +595,3 @@ db_instantiator.add(usrp_dbid.WBX_LO_TX, lambda usrp, which : (db_wbx_lo_tx(usrp db_instantiator.add(usrp_dbid.WBX_LO_RX, lambda usrp, which : (db_wbx_lo_rx(usrp, which),)) -# freq += self._lo_offset -# -# R, N, control, actual_freq = self._compute_regs(freq) -# if R==0: -# return(False,0) -# self._write_all(R, N, control) -# return (self._lock_detect(), actual_freq) - -- 2.47.2