Initialize ADF : ref clock frequency

Dear all,

I would like to know if you have one example to initialize the ADF (see the picture) : upload ref frequency.
With C code example without your lime suite?
Best regards

David

Do you mean not using Lime Suite GUI (as pictured) or actually not using Lime Suite at all? Latter would mean no library which provides LMS API…

Dear Andrew

I want to say without LimeSuite Gui.

BR

David

I Find this in the wiki : But I don’t know if it is fine for my need (program ref clock in = internal clock) to synchronize two board limesdr
int LimeSDRTest_USB::ADF4002Test()to
{
uint32_t data_l[] = { 0x1F8093, 0x1F80F2, 0x0001F4, 0x018001 };
uint32_t data_h[] = { 0x1F8093, 0x1F80B2, 0x0001F4, 0x018001 };
auto port = device->GetConnection();
// ADF4002 needs to be writen 4 values of 24 bits
if (port->TransactSPI(0x30, data_l, nullptr, 4) != 0)
return -1;

if (InitFPGATest(0x08, -1) == -1)
    return -1;

for (int i = 0; i < 5; i++)
{
    if (port->TransactSPI(0x30, data_h, nullptr, 4) != 0)
        return -1;
    if (port->TransactSPI(0x30, data_l, nullptr, 4) != 0)
        return -1;
}

unsigned adf_cnt;
if (port->ReadRegister(0x74, adf_cnt) != 0)
    return -1;

std::string str = "  Result: " + std::to_string(adf_cnt);
if (adf_cnt != 10)
{
        str += " - FAILED";
        UpdateStatus(LMS_TEST_INFO, str.c_str());
        return -1;
}
str += " - PASSED";
UpdateStatus(LMS_TEST_INFO, str.c_str());
return 0;

}

To program specific external clock frequency you can use:
LMS_SetClockFreq(lms_device_t *dev, LMS_CLOCK_EXTREF, float_type freq);

1 Like

thanks Garmus

I just wondering why you need to program the ADF4002 outside of lime suite ?
I plan to syncn several limesuite USB board, I have tested one board use HP 58503A as source and SR 620 for measurement and I get nS phase difference not stellar but its fine for my app. but I really apreciate if You can share Your result

I have a system with several cards which are chained together with their internal clock.
So the first card provides its 30.72Mhz to the next and so on.
So wanting to operate on each card with the external reference clock I have to program ADF with the right value.