Is an example c project available for the ADF4350 no-OS driver ? Perhaps a test program written when the ADF4350.c driver was developed?
ADF4350
Production
The ADF4350 allows implementation of fractional-N or
integer-N phase-locked loop (PLL) frequency synthesizers
if used with an external loop filter and...
Datasheet
ADF4350 on Analog.com
Is an example c project available for the ADF4350 no-OS driver ? Perhaps a test program written when the ADF4350.c driver was developed?
Hi,
Have a look here: no-OS/ad9739a_fmc_ebz.c at master · analogdevicesinc/no-OS (github.com)
AD9739A-EBZ is one the boards where we use the ADF4350.
Thanks,
Dragos
Thanks Dragos,
Could you explain why the frequency register calculations are different in this driver than in the ADF435X Software?
Steve
Hi Steve,
I don't know how the ADF435X Software's internal code looks like, but did you experience any issues with the no-OS driver?
Thanks,
Dragos
Hi Dragos,
I modified adf4350_set_freq in two places:
dev->r1_mod = .5 + (float)dev->fpfd / chspc;
tmp = .5 + ((float)tmp / dev->fpfd);
This was a better match to 2 lines in the Windows .cs GUI that implement rounding:
MOD = (uint)(Math.Round(1000 * (PFDFreq / (decimal)OutputChannelSpacing)));
FRAC = (uint)(Math.Round(((double)N - INT) * MOD));
This change made the actual frequency calculations a bit closer to the target freq and match the GUI behavior.
dev->regs[ADF4350_REG4] =
ADF4350_REG4_FEEDBACK_FUND |
ADF4350_REG4_RF_DIV_SEL(dev->r4_rf_div_sel) |
ADF4350_REG4_8BIT_BAND_SEL_CLKDIV((uint32_t)band_sel_div) |
ADF4350_REG4_RF_OUT_EN |
(dev->pdata->r4_user_settings &
(ADF4350_REG4_OUTPUT_PWR(0x3) |
ADF4350_REG4_AUX_OUTPUT_PWR(0x3) |
ADF4350_REG4_AUX_OUTPUT_EN |
ADF4350_REG4_AUX_OUTPUT_FUND |
ADF4350_REG4_MUTE_TILL_LOCK_EN));
Compiler differences, perhaps, made this necessary,
Steve