Post Go back to editing

ADF4350 no-OS driver example project

Is an example c project available for the ADF4350 no-OS driver ?  Perhaps a test program written when the ADF4350.c driver was developed?

Top Replies

  • 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: 

    1. to implement rounding, I added “(.5+(float)” in 2 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. 

    1. I added this cast, “(uint32_t)”, to prevent band_sel_div sign extension and corruption of the MSBs here:

           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