Si5351A

Controlling the Si5351A programmable clock generator might at first glance seem rather complex or perhaps even scary. Therefore you might revert to using the RFzero code as it is or some of the third party libraries available. But with a little help from your friends from RFzero, you will be in a much better position to tweak the examples, add functionality, or perhaps even write your own functions to control the Si5351A.

Theory behind the Si5351A

The Si5351A consists of two synthesizers, three output dividers, one per output channel, and one output stage per channel that are all controlled via the I2C/Wire bus. A common oscillator circuit, operating at either 25 MHz or 27 MHz, is also built in, but it needs an external crystal.

The synthesizer

If you are not familiar with RF synthesizers, and how they work, you can see them as RF generators, that generate frequencies derived from another frequency, i.e. the reference frequency. In the RFzero this is what the 27 MHz oscillator is used for.

A synthesizer consists of three main electronic circuits: a phase comparator, a VCO and a feedback divider. Silicon Laboratories (SiLabs) names the feedback divider the Feedback Multisynth Divider (FMD). For each different programmed setting of the FMD, the VCO will generate a different frequency.

In many RF applications this is all what is needed, if the wanted output frequencies are in wide steps, e.g. in 25 kHz steps used for FM channels.

The output multisynth divider

To improve the frequency resolution, from wide steps to finer steps, the synthesizer in the Si5351A is followed by a divider circuit, which SiLabs names the Output Multisynth Divider (OMD). In the Si5351A SiLabs has added a second divider stage, called R, that can divide the frequency generated by the synthesizer even further.

The drawback of an output divider is that the output frequency (fout) will be lower than the VCO frequency (fvco). In the Si5351A there is a minimum division of four. This means that the VCO frequency is always at least four times higher than the output frequency.

But instead of having wide frequency steps, e.g. 25 kHz, the steps can be much lower, e.g. 1 Hz. It all depends on how the FMD and OMD ratios are setup.

The math

If you are still with us please stay a bit longer, and we will take you by the hand and walk you through the math, and how to generate the wanted output frequency (fout) derived from the reference frequency (fref). In math lingo the output  frequency can be expressed as:

The Si5351A FMD and OMD ratios can also be expressed:

Please note that SiLabs also names the OMD variables, a, b and c, but, they are NOT THE SAME as those for the FMD. This is an obvious place to get the math wrong. So to avoid the possible misunderstanding in the RFzero world they are named d, e and f respectively instead. Please remember this if you dive into the RFzero code or Si5351A programming guide. But now we can write the complete relationship between the reference frequency and the output frequency:

That’s easy – right? Hmmm, not quite. We now have one equation with seven variables to get from the reference frequency to the output frequency. But the complexity doesn’t stop here. There are some constraints to the different variables and the electronic circuit too:

  • The VCO frequency can only be from 600 MHz to 900 MHz. Yes, over-clocking is possible, and so in under-clocking, to extend the output frequency range beyond 2,5 kHz to 200 MHz. But let’s leave this for now.
  • The FMD ratio can be from 15 + 0/1 048 575 and to 90 + 0/1 048 575, i.e. a = 15, b = 0 and c = 1 048 575 to a = 90, b = 0 and c = 1 048 575. Please remember that c can never be zero (0), as this will violate fundamental math principles.
  • The OMD ratio can be 4 and from 6 to 1800. Please remember that f can never be zero (0), as this will violate fundamental math principles.
  • The R divider can only be 1, 2, 4, 8, 16, 32, 64 or 128.
  • If the output frequency is above 150 MHz d is always 4.
  • If the output frequency is below 500 kHz R should be used, i.e. higher than 1.

You also need to understand a bit more about synthesizer and divider circuits. The FMD and OMD rations are what is called fractional, e.g. 10 + 23 / 4567. But synthesizer and divider circuits produce more spurious when operated in fractional mode than in integer mode, e.g. 10 + 0 / 4567 = 10. So a clever RF designer will assess the situation, and decide if fractional modes are need for both the FMD and the OMD, a mix or use both in integer mode. If a mix is sufficient the OMD should be operated in integer mode if possible.  Furthermore, are even numbers for a and d preferred again due to spurious. The software will have take all this into account.

Agreed, this doesn’t help a lot.

But here comes the first trick to get started. Do a calculation using a test VCO frequency of 600 MHz, if the wanted output frequency is below 150 MHz.

So let’s continue with the above design advises and chose a test VCO frequency of 600 MHz, and a output frequency of 28,567 MHz which means that R = 1.

The second trick is then to work backwards from the output frequency by first calculating the R · OMD radio:

This means that d is 21 and the e/f ratio is 0,0032555046032…

This is neither an integer nor an even one if rounded. So the next trick is to round d up to an even integer, i.e. 22, and check if the resulting VCO frequency is still within the valid range from 600 MHz to 900 MHz. If not then increase the value of d by two. Since we want to use the OMD in integer mode the e/f ratio doesn’t matter, and the FMD will have to take care of this instead. So 22 · 28,567 MHz = 628,474 MHz which is a fine fvco.

We now know that d = 22, e = 0 and f = 1 or any value as long as it is less than or equal to 1 048 575. So we can continue to find the FMD ratio, i.e. a, b and c:

where a = 23 is the integer part of the FMD and b/c = 0,2768148148148… is the remainder.

Hang in there we are almost done. But how do we solve the b/c = 0,2768148148148… equation? The easiest way to do it is to set c to 1 048 575. This results in b equals 290 261.

That’s it! We now have the following values:

  • a = 23
  • b = 290 261
  • c = 1 048 575
  • d = 22
  • e = 0 (static)
  • f = 1 (static)
  • R = 1

But will the output frequency be correct then? Well, let’s check:

OK, not spot on but -111 mHz away.

What if the output frequency is less than 500 kHz? In this case the R divider comes into play. Fortunately the procedure is simple. Multiply the wanted output frequency below 500 kHz with a valid R value (1, 2, 4, 8 … 128) so the frequency becomes greater than 500 kHz. Then do the math using this new intermediate frequency as fout in the above equations, e.g. if you want 100 kHz an R = 8 will bring fout up to 800 kHz. The datasheet says that the R divider can be used below 500 kHz but to get to the lowest frequency the Si5351A can generate this border frequency should be set to 333 334 Hz instead coming from fvco / dmax = 600 MHz / 1800.

Frequency code for the Si5351A

Below is a function that calculates the FMD, OMD and R variables and returns the register values for the Si5351A. In this code the OMD is set to operate in integer mode, thus e = 0 and f = 1.

The code works for frequencies from 2605 Hz and up. According to SiLabs the Si5351A can work up to 200 MHz. It is actually possible to use the Si5351A beyond 280 MHz but the maximum frequency depends very much of the actual Si5351A device. Once you get closer to the frequency limit of the Si5351A, you will experience, that the synthesizer has difficulties getting into a steady state (locked). Beyond 200 MHz the signal-to-noise ratio also decreases. Another way to use the Si5351A at higher frequencies is to use one of the harmonics. But please keep in mind that higher output frequency also means worse spectral performance.

Here is an online tool to calculate the FMD, OMD and R register values.

Putting it all together

We are now almost ready generate a frequency with the Si5351A. But before we can do this a pair of I2C (Wire) read and write functions are needed.

The I2C (Wire) read function.

The I2C (Wire) write function.

For the RFzero the Wire instance must be replaced by WireLocal.

Initializing the Si5351A

In the below example the structure of the initialization of the Si5351A is taken from the flowchart in the datasheet.

The OMD for CLK0 is set to integer mode. Only CLK0 is initialized and with an output stage current of 8 mA. The reference load is set to 6 pF.

The program

The final program is now ready. Add each of the above functions to the .ino file and complete the setup() function.

The setup() and loop() part of the program.