commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9978 - gnuradio/branches/features/cppdb/usrp/host/lib


From: trondeau
Subject: [Commit-gnuradio] r9978 - gnuradio/branches/features/cppdb/usrp/host/lib/legacy
Date: Wed, 12 Nov 2008 17:11:07 -0700 (MST)

Author: trondeau
Date: 2008-11-12 17:11:07 -0700 (Wed, 12 Nov 2008)
New Revision: 9978

Modified:
   gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
Log:
copying changes to db_xcvr250.py in r9973 to c++-based dboard code.

Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc        
2008-11-12 19:43:39 UTC (rev 9977)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc        
2008-11-13 00:11:07 UTC (rev 9978)
@@ -446,8 +446,8 @@
   tx_set_atr_rxval(io_tx_while_rx);
   tx_set_atr_txval(io_tx_while_tx);
         
-  printf("GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X",
-    io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx);
+  //printf("GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X",
+  //  io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx);
 }
   
 
@@ -471,7 +471,7 @@
     scaler = 4.0/3.0;
   }
 
-  if(target_freq > 5.25e9) {
+  if(target_freq > 5.27e9) {
     d_highband = 1;
   }
   else {
@@ -479,9 +479,7 @@
   }
 
   double vco_freq = target_freq*scaler;
-  //ref_clk = usrp()->fpga_master_clock_freq();  // Assumes AD9515 is bypassed
-  double sys_clk = 64e6;
-  //sys_clk = 75e6;
+  double sys_clk = usrp()->fpga_master_clock_freq();  // Usually 64e6 
   double ref_clk = sys_clk / d_ad9515_div;
         
   double phdet_freq = ref_clk/d_ref_div;
@@ -490,9 +488,9 @@
   d_frac_div = int((div-d_int_div)*65536.0);
   double actual_freq = phdet_freq*(d_int_div+(d_frac_div/65536.0))/scaler;
   
-  printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f",
-        target_freq, vco_freq, d_ref_div, phdet_freq,
-        div, d_int_div, d_frac_div, actual_freq);
+  //printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f",
+  //    target_freq, vco_freq, d_ref_div, phdet_freq,
+  //    div, d_int_div, d_frac_div, actual_freq);
 
   set_gpio();
   set_reg_int_divider();
@@ -502,10 +500,23 @@
   args.ok = lock_detect();
   args.baseband_freq = actual_freq;
 
-  printf("lock detect: %d\n", args.ok);
-  //if(!ok) {
-  //    args.ok = self.lock_detect();
-  //    printf("lock detect: %d\n", ok);
+  if(args.ok) {
+    if((target_freq > 5.275e9) && (target_freq <= 5.35e9)) {
+      d_highband = 0;
+      set_reg_bandselpll();
+      args.ok = lock_detect();
+      printf("swap to 0 at %f, ok %d\n", target_freq, args.ok);
+    }
+    if((target_freq >= 5.25e9) && (target_freq <= 5.275e9)) {
+      d_highband = 1;
+      set_reg_bandselpll();
+      args.ok = lock_detect();
+      printf("swap to 1 at %f, ok %d\n", target_freq, args.ok);
+    }
+    if(!args.ok){
+      printf("Fail %f\n", target_freq);
+    }
+  }
   return args;
 }
 





reply via email to

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