External ref

Does any alteration to code or firmware need to be made in order to get
a USRP2 to lock to an external 10MHz reference?

Clarification to last- I see it can be done in Python with UHD, but
without, do I need to put
clocks_mimo_config(MC_WE_LOCK_TO_SMA); in clocks.c- perhaps in place
of WC_WE_DONT_LOCK on like 52
or is there a way to do it in python for non UHD?

On Wed, Nov 10, 2010 at 12:44 AM, Brett L. Trotter
[email protected] wrote:

Does any alteration to code or firmware need to be made in order to get
a USRP2 to lock to an external 10MHz reference?

No firmware changes with UHD. Code looks something like this.

uhd::clock_config_t clock_config;
clock_config.ref_source = uhd::clock_config_t::REF_SMA;
clock_config.pps_source = uhd::clock_config_t::PPS_SMA;
clock_config.pps_polarity = uhd::clock_config_t::PPS_NEG;

dev = uhd::usrp::single_usrp::make(dev_addr);
dev->set_clock_config(clock_config);

Thomas

On 11/09/2010 11:44 PM, Brett L. Trotter wrote:

Does any alteration to code or firmware need to be made in order to get
a USRP2 to lock to an external 10MHz reference?

I’m still looking for more information on this subject, and have some
additional information to add.

We’re still in the non UHD realm, but looking into trying out the Python
method of telling the AD9510 to use the 10M refclock. In any case, I
wrote a new firmware that enabled the test output and told it to lock to
SMA, but I was unable to confirm based on the reported PPM drift in our
receiver or by scoping the test clock outs on both usrps at the same
time.

The only conclusion we could come to by going back and forth between the
standard firmware and my ref sync firmware was that the test port was
being enabled but that the PPM generally stayed in the same range and
felt like either the clocks are good enough the oscillator wasn’t
helping, they’re syncing up with eachother by proximity effect, or we’re
doing something wrong with the sync enable.

So the questions I have are:

  1. I initially modified txrx.c
    int
    main(void)
    {
    u2_init();
  • // trigger lock to SMA
  • clocks_mimo_config(MC_WE_LOCK_TO_SMA);
  • // enable debug clock
  • clocks_enable_test_clk(true, 1);

which definitely enabled the output port.
I later tried changing MC_WE_DONT_LOCK in clocks.c to MC_WE_LOCK_TO_SMA,
but saw no change which was generally expected. Am I doing the right
thing or is there something more we should be doing to properly enable
the ref sync?

  1. the docs are saying the UHD firmware lights up LED E for ref sync,
    but non UHD firmware has no indication. Is there a way to enable the
    same light in the non UHD firmware?

  2. just out of curiosity, what’s involved in enabling J505 (the 2nd
    output of the DS90CP22) just as it would give us one more place to prove
    the clock is getting in to the USRP2.

All in all it seems UHD is the answer, but non-UHD is the more known
entity to us. If you have answers to any or all of these questions, any
thoughts or confirmation would be really handy.

-Brett