etherkit / Si5351Arduino

Library for the Si5351 clock generator IC in the Arduino environment
GNU General Public License v3.0
229 stars 94 forks source link

multisynth_calc when r_div applied #78

Closed mrguen closed 3 years ago

mrguen commented 3 years ago

In the multisynth_calc(uint64_t freq, uint64_t pll_freq, struct Si5351ARegSet *reg)

There is a test if the frequency is under Si5351A_MULTISYNTH_MIN_FREQ * Si5351A_FREQ_MULT and setting it to this min value.

This makes all output for frequencies under Si5351A_MULTISYNTH_MIN_FREQ * Si5351A_FREQ_MULT the same and wrong.

I think the code should be

if (freq < Si5351A_MULTISYNTH_MIN_FREQ * Si5351A_FREQ_MULT)
{
    freq = select_r_div(&freq) * freq;
}