commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6135 - gnuradio/trunk/gr-usrp/src


From: matt
Subject: [Commit-gnuradio] r6135 - gnuradio/trunk/gr-usrp/src
Date: Tue, 14 Aug 2007 20:44:48 -0600 (MDT)

Author: matt
Date: 2007-08-14 20:44:48 -0600 (Tue, 14 Aug 2007)
New Revision: 6135

Modified:
   gnuradio/trunk/gr-usrp/src/db_wbx.py
Log:
progress


Modified: gnuradio/trunk/gr-usrp/src/db_wbx.py
===================================================================
--- gnuradio/trunk/gr-usrp/src/db_wbx.py        2007-08-13 23:35:59 UTC (rev 
6134)
+++ gnuradio/trunk/gr-usrp/src/db_wbx.py        2007-08-15 02:44:48 UTC (rev 
6135)
@@ -510,9 +510,30 @@
                 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_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)
-





reply via email to

[Prev in Thread] Current Thread [Next in Thread]