Re: Si5351 Programming Flowchart

Jerry Gaffke

That flowchart describes how to code low level si5351 routines,
not how to use those routines.  So probably not of much intereset
to most of the readers of this forum.

Allard's Bitx40 firmware and in Farhan's uBitx firmware currently use the si5351bx routines,
to use them just embed the two functions si5351bx_init() and si5351bx_setfreq() into your sketch.
Call si5351bx_init() once at startup, all three clk's get initialized to the off state.
Call si5351bx_setfreq(clknum, fout) each time you wish to change the frequency of a clock
with clknum a value of 0, 1, or 2, and fout in hz between 500khz and 109mhz.
Use a frequency of 0 hz if you wish to turn one of the clocks back off.
To calibrate, adjust the value of si5351bx_vcoa and then call si5351bx_setfreq() for each of the active clocks.

Resolution is to one hz, since fout in hz is an integer.  (Though we could go to a fractional fixed point representation if necessary.)
The accuracy of the calculations is down around 1ppm, considerably better than the stability of the 25mhz reference oscillator.

There has been one minor bug found since the si5351bx code was made available last summer, this line:
    i2cWrite(183, SI5351BX_XTALPF << 6);
should be changed to this:
    i2cWrite(183, (SI5351BX_XTALPF << 6) | 0x12);
to agree with the recommendations in the SiLabs apnote AN619
This may improve phase noise, though I have not heard any reports of it making any perceivable difference.

The code from Pavel (and the code from Etherkit or G0UPL) will allow you to exceed the 109mhz max frequency
if that is of interest.  There may be differences in phase noise, though again I am not aware of this being perceptible by
anyone in this forum. 

Jerry, KE7ER

On Mon, Feb 12, 2018 at 09:07 am, JuanCarlos Berberena Gonzalez wrote:
Hi Guys
A weeks ago Josué Marin-CO7RR- sent me this information to share with my group.
I am only try to be a good 'USER" testing some interesting project I can get on the web and afterward share it with my group.
Now Pavel-CO7WT- sent me this link and I think is a good idea to share with all of you.

Join to automatically receive all group messages.