Si5351 module does not work properly with etherkit si5351 library off about  2mh - Page 1
Forum section: electronics / beginners

author: PankajBeniwalT
author_rank: Newbie
timestamp: March 27, 2025, 02:18:51 pm
content: My new si5351 module does not work properly with etherkit si5351 library , it`s off about 2 mhz when try to calibrate it using calibration sketch in the etherkit library by jason at 10 mhz.But when i used adafruit si5351 library it works very well and also worked with si5351mcu.h library and only off by couple hundred of hertzs.So I have no idea why it 's not working properly with etherkit library .

author: ftg
author_rank: Frequent Contributor
timestamp: March 27, 2025, 04:35:57 pm
content: Check the crystal on the module.I have seen both 25MHz and 27MHz.The original Adafruit Si5351 modules, from which most these are cloned, use 25MHz crystals.I don't recall if the Etherkit library expects 25MHz or 27MHz crystal, but that should be a #define or something to change.

author: radiolistener
author_rank: Super Contributor
timestamp: March 27, 2025, 08:35:25 pm
content: Quote from: PankajBeniwalT on March 27, 2025, 02:18:51 pmConsidering that the minimum output frequency of the si5351 is approximately 5 kHz, a deviation of 0.002 Hz translates to about 0.4 ppm (parts per million). This is a very good result.Typically, the si5351 is used in the frequency range of 1-200 MHz. If you achieved a frequency offset of 2 mHz (0.002 Hz) at 2 MHz (2'000'000 Hz), the deviation would be 0.001 ppm - an extraordinarily precise outcome, far exceeding the typical expectations for this synthesizer.Such minimal offsets are often overshadowed by the initial tolerance and temperature-induced frequency drift of the onboard crystal. For improved stability beyond this level, upgrading to a high-precision TCXO or OCXO would be necessary, though it comes at the cost of increased size and expense.In short, achieving 2 millihertz accuracy with the SI5351 is already an excellent result.

author: Howardlong
author_rank: Super Contributor
timestamp: March 27, 2025, 08:49:09 pm
content: QuoteDepending on the target frequency, this is rubidium territory ;-)For the OP. if you're after a good test of your embedded software skills, you could always write your own driver. Writing a working generic Si5351 driver isn't what I'd call trivial.

author: radiolistener
author_rank: Super Contributor
timestamp: March 27, 2025, 10:20:25 pm
content: Quote from: Howardlong on March 27, 2025, 08:49:09 pmIts simple, they using Multisynt technology, which is actually multiplier and divider for XTAL frequency.Both multiplier and divider are defined with 3 integer parameters a+b/c.But if you want to change frequency with no PLL reset, to get continuous frequency sweep, it may be really tricky. The problem here is to change frequency in that way that PLL keep locked and its reset can be skipped

author: 807
author_rank: Frequent Contributor
timestamp: March 28, 2025, 05:40:34 pm
content: Quote from: PankajBeniwalT on March 27, 2025, 02:18:51 pmWhen discussing frequencies, it's important to use the correct prefix. m = milli (/1000), M= Mega (x1000).I assume you mean that the frequency was off by 2MHz when set to 10MHz. Was it higher or lower?Also, just to be pedantic, it's Hz not hz.

author: newbrain
author_rank: Super Contributor
timestamp: March 29, 2025, 01:41:01 am
content: Quote from: 807 on March 28, 2025, 05:40:34 pmEhm...

author: fourfathom
author_rank: Super Contributor
timestamp: March 29, 2025, 06:21:06 am
content: The OP obviously meant 2 MHz, not milliHz, since they later mentioned that being "off by couple hundred of hertz" was "working very well". It might very well be the 25 vs 27 MHz xtal issue that poster ftg suggested.

author: 807
author_rank: Frequent Contributor
timestamp: March 29, 2025, 07:26:10 pm
content: Quote from: newbrain on March 29, 2025, 01:41:01 amOops! How embarrassing.m = milli (/1,000), M= Mega (x 1,000,000)

author: Howardlong
author_rank: Super Contributor
timestamp: April 01, 2025, 04:47:58 am
content: Quote from: radiolistener on March 27, 2025, 10:20:25 pmThey said they are using a library that isn't working. While the underlying chip's hardware has "multisynths", that's only one part of the jigsaw.If the library is one of those I've seen for the Arduino, it's hardly trivial.QuoteFYI, I've been using this chip in commercial products since 2012, so I'm well aware of how it works, and it is certainly NOT as "simple" as you describe.QuoteIrrespective of whether it's a sweep or not, to set an arbitrary frequency within the device's range, you have some work to do, and it is certainly NOT as simple as a single a+b/c: I suspect you haven't written such code yourself if you think it's that easy. There are multiple interacting and potentially conflicting considerations at play when programming this device, not least is understanding the device, and its 100 odd registers.Now you could use the Silabs software to produce a complete register set up for a single set of fixed frequencies, one for each output, but that is a very long way from dynamically programming arbitrary frequencies at will, i.e. ageneric driver, which is what we are discussing.

author: radiolistener
author_rank: Super Contributor
timestamp: April 01, 2025, 11:02:12 pm
content: Quote from: Howardlong on April 01, 2025, 04:47:58 amyou don't needs 3rd party library, you can write your own code to control it.Quote from: Howardlong on April 01, 2025, 04:47:58 amFYI, I have been using the Si5351 in my hobby projects since around 2017. I do not rely on third-party libraries, as they often contain errors and hardcoded parameters.Instead, I developed my own implementation, which functions reliably. Once you understand how the Multisynth works, the configuration becomes straightforward. The device operates exactly as I said and using it pretty simple. There is a little bit more details - it also has additional dividers that can be enabled as needed and uses two PLLs for frequency multiplication and three dividers for frequency division, though these are just implementation details.All you need for the implementation is a register write function, functions to configure PLL coefficients and dividers, and a function to select the multiplication and division factors for a given frequency. That’s it.For simplicity or to play with precise settings you can just hardcode multiplication and division settings.

author: radiolistener
author_rank: Super Contributor
timestamp: April 02, 2025, 11:35:17 pm
content: Quote from: Howardlong on April 01, 2025, 04:47:58 amYou are mistaken. I have developed that code, including several versions for different projects, and I even published some of them on this forum years ago to control the si5351.Additionally, if you're familiar with NanoVNA, its firmware includes some of my fixes, include si5351.Quote from: Howardlong on April 01, 2025, 04:47:58 amIt is unnecessary to use that software for the si5351, as calculating the register contents at runtime within your code is more efficient, straightforward, and flexible, allowing for more precise results without any limitations, provided that your MCU has sufficient resources. For instance, even the STM32F103 has more than enough processing power to perform this task in real-time.I have even experimented with creating a sweep generator and FM modulation on the si5351. With a sufficiently high register update rate and some optimizations, this is also achievable.With using bluepill (STM32F103C8) you can update frequency on si5351 200-300 times per second with no issue, include selecting best muliplication and division factors to get minimum jitter.These ready-made register calculation software from manufacturer are designed for beginners who prefer not to delve into the datasheet and simply want to obtain ready-made register values without writing any code.

author: Howardlong
author_rank: Super Contributor
timestamp: April 14, 2025, 10:09:18 am
content: Quote from: radiolistener on April 01, 2025, 11:02:12 pmPrecisely.QuoteAnd there's the rub. "Once you understand how the Multisynth works", it really is NOT straightforward if you want have multiple arbitrary frequencies with only two PLLs, and, for example, want to prioritise integer PLLs for certain outputs, or, for example, you want control over phase or frequency coherence between multiple outputs.This is a classic engineering problem: with limited resources, and multiple requirements, you have to make compromises, and some of those compromises might work for one use case but not another.This is certainly not the trivial task you're portraying.

author: radiolistener
author_rank: Super Contributor
timestamp: April 14, 2025, 10:51:07 am
content: Quote from: Howardlong on April 14, 2025, 10:09:18 amYou are absolutely right that with only two PLLs and 3 arbitrary frequencies, compromises are inevitable - that’s a system limitation, not a configuration complexity. However, the actual process of calculating register values and programming the si5351 is straightforward once you understand the Multisynth principle. The challenge you mention is architectural - about planning frequency allocation, not about the chip configuration itself.No external library will make these architectural choices for you if you don't fully understand how the Multisynth works under the hood. In fact, it’s clearer and safer to implement your own control code than to adapt existing libraries whose internals you may not fully trust. Writing direct si5351 control code is simple and transparent, without hidden pitfalls or unexpected constraints.Some complexities with si5351 programming arise only when pushing the chip to its absolute limits, beyond the datasheet specifications - for example, maintaining PLL lock during abrupt frequency changes without resets that would cause clock dropouts. There are also undocumented tricks to get extra performance from the chip. However, these advanced techniques are not implemented in standard libraries, so they won’t help you in such cases. If you simply need to configure frequencies within the datasheet limits, the control code remains straightforward and direct.