Reclocking the USRP-1 for OpenBTS¶
The default clock of the USRP is 64Mhz. GSM clocks are derived from a 13 Mhz so multiples of 13 are "good clocks" for the host. Reclocking the USRP to 52 Mhz will make your host more CPU efficient.
52 MHz clock sources for OpenBTS¶
There are presently two choices widely used with OpenBTS:
- http://code.google.com/p/clock-tamer/. The Fairwaves СlockTamer, a configurable 2MHz-65MHz reference clock generator with 0.28ppm TCXO. Can be calibrated against existing GSM network to better then 50ppb precision. Has option to sync clock to GPS.
- http://www.box73.de/catalog/product_info.php?products_id=1869. The Funkamatuer FA-SYS1. Requires modification to decrease its output voltage to prevent USRP input burn out.
So now you've got an external clock signal, probably a stable 52Mhz clock, and you want to run OpenBTS with it. Here are the hardware and software setup instructions.
Hardware modifications to the USRP to use a external clock.¶
- Solder an SMA connector into J2001. This is the clock input. Be careful when soldering the SMA connector so you don't break the delicate trace from J2001 to C927.
- Move R2029 to R2030. This disables the onboard clock. R2029/R2030 is a 0-ohm resistor.
- Move C925 to C926.
- Remove C924.
- If you use external clock with CMOS output, then you have to add terminating 50 Ohm resistor to the USRP clock input, like shown here: http://code.google.com/p/clock-tamer/wiki/ClockTamerUSRPInstallation
Software modifications to gnuradio:¶
For gnuradio ver. 3.1.3:
- In usrp/host/lib/legacy/usrp_basic.h, line 122 should read
long fpga_master_clock_freq () const { return 52000000; } - In usrp/host/lib/legacy/usrp_standard.cc, line 703 should be commented out
//assert (dac_freq () == 128000000);
- In gr-usrp/src/db_flexrf.py, line 161 should read
return 52e6/self._refclk_divisor()
- run "make install"
- rebuild openbts
- modify OpenBTS.config (or whatever config file you are using) so that TRX.Path points to "../Transceiver52M/transceiver".
- In usrp/host/lib/legacy/usrp_basic.cc, line 117 should read
d_verbose (false), d_fpga_master_clock_freq(52000000), d_db(2)
- In usrp/host/lib/legacy/usrp_standard.cc, line 1024 should be commented out
// assert (dac_rate() == 128000000);
- In usrp/host/lib/legacy/db_flexrf.cc, line 179 should read
return 52e6/_refclk_divisor();
- run "make install"
- rebuild openbts
- modify OpenBTS.config (or whatever config file you are using) so that TRX.Path points to "../Transceiver52M/transceiver".
For gnuradio ver. 3.3 and higher:
- No changes to gnuradio are necessary if do not need default gnuradio applications and examples (like usrp_fft.py). If you need them, then you should apply the following patch:
diff --git a/usrp/host/lib/usrp_basic.cc b/usrp/host/lib/usrp_basic.cc index 5b2f7ff..8f50ff2 100644 --- a/usrp/host/lib/usrp_basic.cc +++ b/usrp/host/lib/usrp_basic.cc @@ -107,7 +107,7 @@ usrp_basic::usrp_basic (int which_board, : d_udh (0), d_ctx (0), d_usb_data_rate (16000000), // SWAG, see below d_bytes_per_poll ((int) (POLLING_INTERVAL * d_usb_data_rate)), - d_verbose (false), d_fpga_master_clock_freq(64000000), d_db(2) + d_verbose (false), d_fpga_master_clock_freq(52000000), d_db(2) { /* * SWAG: Scientific Wild Ass Guess. - modify OpenBTS.config (or whatever config file you are using) so that TRX.Path points to "../Transceiver52M/transceiver".
Known Problems¶
As of release 2.5 "Lacassine", the 52 MHz modifications do not work with Mac OS X systems. If you use OS X, you will need to continue to use a 64 MHz clock.