commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5002 - gnuradio/branches/developers/nldudok1/general-


From: nldudok1
Subject: [Commit-gnuradio] r5002 - gnuradio/branches/developers/nldudok1/general-wip/gnuradio-examples/python/cxadc
Date: Sun, 15 Apr 2007 09:52:13 -0600 (MDT)

Author: nldudok1
Date: 2007-04-15 09:52:13 -0600 (Sun, 15 Apr 2007)
New Revision: 5002

Modified:
   
gnuradio/branches/developers/nldudok1/general-wip/gnuradio-examples/python/cxadc/cxadc_wfm_rcv.py
Log:
added crystal freq selection

Modified: 
gnuradio/branches/developers/nldudok1/general-wip/gnuradio-examples/python/cxadc/cxadc_wfm_rcv.py
===================================================================
--- 
gnuradio/branches/developers/nldudok1/general-wip/gnuradio-examples/python/cxadc/cxadc_wfm_rcv.py
   2007-04-14 21:11:00 UTC (rev 5001)
+++ 
gnuradio/branches/developers/nldudok1/general-wip/gnuradio-examples/python/cxadc/cxadc_wfm_rcv.py
   2007-04-15 15:52:13 UTC (rev 5002)
@@ -37,6 +37,8 @@
                           help="set frequency to FREQ", metavar="FREQ")
         parser.add_option("-i", "--if-freq", type="eng_float", default=5.75e6,
                           help="give IF frequency of rf-frontend 
[default=5.75e6] set to zero, if you have no frontend.", metavar="FREQ")
+        parser.add_option("-c", "--crystal-freq", type="eng_float", 
default=28.63636e6,
+                          help="give the freq of the crystal mounted on the 
tv-card [default=28.63636e6].", metavar="FREQ")
         parser.add_option("-g", "--gain", type="eng_float", default=40,
                           help="set gain in dB (default is midpoint)")
         parser.add_option("-V", "--volume", type="eng_float", default=None,
@@ -62,7 +64,7 @@
         if self.use_usrp_for_tuning:
           self.u = usrp.source_c()                    # usrp is only used for 
tuning TVRX of which you can connect the IF-output to the cx2388xx TV capture 
card video-in
         expected_crystal_freq=28.63636e6
-        actual_crystal_freq=32.0e6 #I modified my board with a 32 MHz crystal, 
default this is a 28.63636e6 crystal or oscillator
+        actual_crystal_freq=options.crystal_freq #32.0e6 #28.63636e6 #I 
modified my board with a 32 MHz crystal, default this is a 28.63636e6 crystal 
or oscillator
         default_resample_rate=27.0e6
         resample_rate=default_resample_rate
         adc_rate=   resample_rate *  actual_crystal_freq/expected_crystal_freq
@@ -297,7 +299,17 @@
           self._set_status_msg("Failed", 0)
           return False
         else:
-          print "Not implemented yet"
+          try:
+            r = self.cxadc.set_freq(target_freq)           
+            if r:
+              actual_freq=self.cxadc.freq()
+              self.myform['freq'].set_value(actual_freq)         # update 
displayed value
+              self.myform['freq_slider'].set_value(target_freq)  # update 
displayed value
+              self._set_status_msg("OK", 0)
+              print "target_freq",target_freq,"actual_freq",actual_freq
+              return True
+          except:
+            print "Set_freq not implemented yet"
           self._set_status_msg("Failed", 0)
           return False
 





reply via email to

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