diff options
author | matt | 2007-08-15 02:44:48 +0000 |
---|---|---|
committer | matt | 2007-08-15 02:44:48 +0000 |
commit | 3e0fb6a5b33c5165766ddaf0c1d046c89db9f86f (patch) | |
tree | 06efd24a90703977a9a5607093d064095b8fd2e3 /gr-usrp | |
parent | 6a341feb050f97b258594a968403ee4e65f44455 (diff) | |
download | gnuradio-3e0fb6a5b33c5165766ddaf0c1d046c89db9f86f.tar.gz gnuradio-3e0fb6a5b33c5165766ddaf0c1d046c89db9f86f.tar.bz2 gnuradio-3e0fb6a5b33c5165766ddaf0c1d046c89db9f86f.zip |
progress
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6135 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-usrp')
-rw-r--r-- | gr-usrp/src/db_wbx.py | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/gr-usrp/src/db_wbx.py b/gr-usrp/src/db_wbx.py index 530692915..c008d76e0 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<<SELA0) | (self.aux_div<<SELB0)), - (SELA0|SELA1|SELB0|SELB1)) # only works on RX + self._u._rx_write_io(self._which, ((self.main_div<<SELA0) | (self.aux_div<<SELB0)), + (SELA0|SELA1|SELB0|SELB1)) # only works on RX + def set_freq(self, freq): + #freq += self._lo_offset + + if(freq < 20e6 or freq > 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) - |