Hi, all,

I am having a USRP E312 and is working on implementing a stepped frequency 
radar application. The bandwidth of the radar is 1 GHz and the frequency step 
size is 10 MHz. My current implementation is similar to the example code 
“txrx_loopback_to_file.cpp” : a transmit thread sending a same baseband signal 
at the background; a loop handling the tuning center frequency and receiving 
data to a buffer.

The following shows the code snippets.

1. the transmit thread: just sending a same baseband signal continuously

   void transmit_worker (std::vector<std::complex<float>> buff, \
   uhd::tx_streamer::sptr tx_streamer, \
   uhd::tx_metadata_t metadata, \
   int num_channels) \
   { 

   std::vector<std::complex<float>\*> buffs(num_channels, &buff.front());

   ```
   // send data until the signal handler gets called
   while (not stop_signal_called) {
   
       // send the entire contents of the buffer
       tx_streamer->send(buffs, buff.size(), metadata);
   
       metadata.start_of_burst = false;
       metadata.has_time_spec  = false;
   }
   
   // send a mini EOB packet
   metadata.end_of_burst = true;
   tx_streamer->send("", 0, metadata);
   ```

   }

2. the loop handling the tuning and receiving:

I use the usrp.get_time_now() function to timing the loop. Here is what I’ve 
found: The uhd ad9361 seems to run a calibration procedure when there is a 
frequency jump over 100 MHz. And each calibration takes about 2 seconds for my 
measurements. With my current setup (100 steps and 10 MHz frequency step size), 
the total time of the loop is 25.6 seconds. There are 9 calibrations in the 
loop which takes 18 seconds.

My goal is to find the source code that implements AD9361’s tuning function in 
the UHD source code so that I can comment out the calibration part to speed up 
the frequency tuning.

The following source code files are related to AD9361 tuning:

* the set_tx_frequency() implemented in 
`uhd/host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp`

* the tune method in line 227 in the above figure calls the tune() function in: 
`uhd/host/lib/usrp/dboard/e3xx/e3xx_ad9361_iface.cpp`

**Notice that the original source code is “catalina_tune” and I changed it to 
“tune” because my experiments showed “tune” is much faster than 
“catalina_tune”.**

* Finally, I find the tune() function above seems to call the tune() function 
in: `uhd/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp`

I find in line 85 AD9361_CAL_VALID_WINDOW is defaulted to 100 MHz and I change 
the 100 MHz to 1 GHz. But nothing seems to change, the device still do a 
calibration every 100 MHz.

I also comment out the calibration code in 
`uhd/host/lib/usrp/common/ad9361_driver/ad9361_device.cppb`, but still nothing 
seems to be changed. The device is still doing calibration every 100 MHz.

**Anyone knows where the source code for tuning ad9361 with E312 device is ? I 
wish I can locate the tuning source code so that I can change it to speed up 
frequency tuning.** In my application, if I can turn off the calibration that 
happens every 100MHz, then the total tuning time is only 8 seconds, which is 
just what I need. But I can not locate the true tuning source code.

Thanks,

Yan
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to