Author Topic: Windows Freeware GUI for Si5351A DIY Function Generator? Solved  (Read 2556 times)

0 Members and 1 Guest are viewing this topic.

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
I would like to create a function generator, using an Adafruit Si5351A module. There are lots of projects that use an Arduino, a display and various buttons and knobs to set the outputs. I would prefer to interface with the module with my old Windows XP laptop, via USB. Why not get some more use out of it?

I am not a strong coder and creating such a GUI is out of my depth. (I know that there are on-line GUI configurers, but that seems dangerous.) So, I am hoping someone can point me in the proper direction. I did not find anything in my searches. I really don't even know the proper coding terms to use to do a good search.

Here's what I envision:
Windows XP/GUI
via USB to
MCU (Arduino [UNO, Classic Nano, or Every] or older PIC [12F, 16F, 18F. I have a PIC18F4550 demo board with USB that I DIY'd.])
via I2C to
Si5351A Module
Anybody know of such a GUI?

I will also need help with the MCU libraries and code. I have the needed programmers and can manage to flash the MCU.

Thank you for your help.
« Last Edit: May 01, 2023, 01:47:09 am by t1d »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #1 on: April 23, 2023, 08:51:46 am »
I would like to create a function generator, using an Adafruit Si5351A module. There are lots of projects that use an Arduino, a display and various buttons and knobs to set the outputs. I would prefer to interface with the module with my old Windows XP laptop, via USB. Why not get some more use out of it?
via USB to MCU ... older PIC [12F, 16F, 18F. I have a PIC18F4550 demo board with USB that I DIY'd.])  via I2C to  Si5351A Module

Why not take the path most travelled ?
If there is already working code on Ardunio, you really just need to use the existing serial pathway, to replace/emulate the manual entry schemes.
You thus avoid needing any i2c or Si5351 register bashing at all, you just use the code that exists to do that.

Addit: eg this one seems to bridge Serial to Si5351 in a console manner, so a terminal (or your GUI) on PC side can control things
https://github.com/brucemack/Si5351-Console
 


« Last Edit: April 23, 2023, 09:24:56 am by PCB.Wiz »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #2 on: April 24, 2023, 01:05:19 am »
Addit: eg this one seems to bridge Serial to Si5351 in a console manner, so a terminal (or your GUI) on PC side can control things
https://github.com/brucemack/Si5351-Console
Excellent! Thank you! I would have never found it.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #3 on: April 24, 2023, 08:03:57 am »
That code, as many others floating around for the Si5351(A), uses the Etherkit library.

The library is very complete, but I find one main problems with it: the initialization sequence does not reset the Spread Spectrum register to disable spread spectrum.
At switch on, there's absolutely no guarantee that the spread spectrum feature is disabled (AN619 gives the reset value as xxxx xxxx), and in fact, on all the Si5351 I have it defaults as enabled.
Spread spectrum will just add a ton of jitter to the generated clocks.

To solve this, you can add:
Code: [Select]
si5351_write(SI5351_SSC_PARAM0, 0);to the beginning of void Si5351::reset(void) in Si5351.cpp.

Also the algorithm used to calculate the fractional divisors just uses a fixed denominator instead of finding the best fraction that can represent the fractional part (e.g. with an Euclid Continuous Fraction algorithm).
This is just an algorithmic pet peeve of mine, as the effect will not be measurable (at worst, less than 125 ppb) given the abysmal quality of the crystals provided with Si5351 modules.
I have got some from AliExpress, and some from Adafruit. For both, the crystals are pure crap: out by hundreds of ppms.
Albeit the lib foresees a calibration value, the crystal is so temperature sensitive that if you frown at it it'll change frequency...

Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: PCB.Wiz, paul002

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #4 on: April 25, 2023, 07:43:52 am »
That code, as many others floating around for the Si5351(A), uses the Etherkit library.

...

Also the algorithm used to calculate the fractional divisors just uses a fixed denominator instead of finding the best fraction that can represent the fractional part (e.g. with an Euclid Continuous Fraction algorithm).
This is just an algorithmic pet peeve of mine, as the effect will not be measurable (at worst, less than 125 ppb) given the abysmal quality of the crystals provided with Si5351 modules.
I have got some from AliExpress, and some from Adafruit. For both, the crystals are pure crap: out by hundreds of ppms.
Albeit the lib foresees a calibration value, the crystal is so temperature sensitive that if you frown at it it'll change frequency...
The errors are probably just lazy CL selection and cheapest Xtal sourcing.


The latest revised etherkit (revD) has TCXO options
https://etherkit.github.io/si5351abb_landing_page

uses ASTX-H11-25.000MHZ-T TCXO or ECS-250-8-30B-CKM xtal

You can also fit a clipped sine oscillator, by swapping R8 for 100pF~1nF and removing R7,R9
I see ECS have some new TCXO they claim use 'analog compensation', which I think just means more frequent and smoother tracking.


 
The following users thanked this post: newbrain

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #5 on: April 25, 2023, 09:25:21 am »
As said, the choice of going for a slightly sub optimal fraction is not a real fault (the Linux kernel driver does the same), fo all practical purposes the result is the same.

The spread spectrum one is instead an actual verifiable issue. I might rise an issue/PR on GH.

I don't use either the library or that specific board, but, for the HW, I also use a TCXO when warranted or a decent crystal.
It was just a warning about the more common Aliexpress or even Adafruit modules that can be found around.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #6 on: April 25, 2023, 08:46:55 pm »
Thank you for the great input, newbrain and PCB.Wiz!

The various coding issues are interesting and I can (sort of) follow along.
I m-i-g-h-t be able to add this code, but I am sure that I will have questions, when I attempt it. It will be fun to give it a try.
To solve this, you can add:
Code: [Select]
si5351_write(SI5351_SSC_PARAM0, 0);
to the beginning of void Si5351::reset(void) in Si5351.cpp.


I was aware of the issues with using the cheap pill can crystals. I had stocked in some of those for breadboarding and a TCXO, to DIY a Demo Board.
TCXO = ECS-TXO-2016MV-250-TR
I am also aware that a 27MHz crystal will allow you to access some radio frequencies that the 25MHz will not. However, Mouser did not have a 27MHz TCXO when I placed my order... Or, maybe it was too expensive... I forget... Anyway, if I can come up with a 27MHz in the same footprint, I can just swap it on the board.

Here's my circuit:


I made some design decisions...
- To avoid level shifting, I went with a fully 3V3 system. Meaning, I will run the Si5351A, the Nano and any future display on 3V3 by injecting 3V3 into the board through the 5V Output Pin. The 5V Output Pin is after the 5V V Reg. This is a known trick and I have used it before. I have a separate module for level shifting for using the Laptop.
- I went with the TCXO.
- I went directly to the Demo Board and skipped breadboarding. I will probably do a breadboard, while I wait for the boards to arrive = ~20 days. This will give me the opportunity to set up the software side of things.
- I added DC Blocking Caps on the Clock Outputs. I read this suggestion somewhere. I am not sure that they are needed. If not, I will just jump them.

Here is the Board...


My post has stirred a really great discussion of things I would not have imagined. Thank you for your wonderful help.
« Last Edit: April 25, 2023, 09:02:09 pm by t1d »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #7 on: April 25, 2023, 09:45:54 pm »
I was aware of the issues with using the cheap pill can crystals. I had stocked in some of those for breadboarding and a TCXO, to DIY a Demo Board.
TCXO = ECS-TXO-2016MV-250-TR
you will need some options between the TCXO and XA, as XA has a unusual MAX vin on the data.

Clipped Sine TCXO you can AC couple   (see fig 6.6  VIN = 1 VPP   25~27 MHz  Note: Float the XB input while driving the XA input with a clock 0.1 μF ( I'd use 100pF~1nF as 100n is very high for 25MHz )
CMOS in needs Table13 : VIN_XA/B Pins XA, XB –0.5 to 1.3 V  so a 2 resistor divider may be needed and maybe a AC coupling cap to XA.

- I added DC Blocking Caps on the Clock Outputs. I read this suggestion somewhere. I am not sure that they are needed. If not, I will just jump them.
If it AC couples into a RF load, caps are useful but if you want to clock other CMOS parts, the caps are not needed.

I've seen people use multi-footprints for the oscillator, as that allows more choices. eg If you ever want to go sub ±0.5ppm, those are larger packages.

Ferrite beads and maybe a local regulator are also useful to keep the RF local, and the oscillator supply clean.

Options on the TCXO pin1 are also common - pull up / pull down, and even a trim pot, if you get a VCTCXO

You could also look at the new
ECS-TXO-20CSMV-AC260-AY-TR  Temperature Compensated Crystal Oscillator (TCXO) 26MHz ±0.5ppm Clipped Sinewave 4-Pin CSMD T/R

For fun, you could add a 74AHC1G4215GW   / 74AHC1G4214GW  SOT353 divider footprint to one CLK OUT, to allow you to generate 1pps for cross checking with GPS 1pps signals.    
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #8 on: April 26, 2023, 04:00:36 am »
you will need some options between the TCXO and XA, as XA has a unusual MAX vin on the data.
Clipped Sine TCXO you can AC couple   (see fig 6.6  VIN = 1 VPP   25~27 MHz  Note: Float the XB input while driving the XA input with a clock 0.1 μF ( I'd use 100pF~1nF as 100n is very high for 25MHz )
CMOS in needs Table13 : VIN_XA/B Pins XA, XB –0.5 to 1.3 V  so a 2 resistor divider may be needed and maybe a AC coupling cap to XA.
Thank you so much for pointing that out. I just totally missed it. That scraps the board, I guess - no way to bodge it. Good thing it was only $3.05.
I know that I own the mistake, because this detail is in the datasheet. However, isn't this oddly engineered? I would have never expected that XA's voltage in would not be equal to Vdd. And, if it is an unique engineering point, maybe it could have been more prominently highlighted in the text? 
- I added DC Blocking Caps on the Clock Outputs. I read this suggestion somewhere. I am not sure that they are needed. If not, I will just jump them.
If it AC couples into a RF load, caps are useful but if you want to clock other CMOS parts, the caps are not needed.

I've seen people use multi-footprints for the oscillator, as that allows more choices. eg If you ever want to go sub ±0.5ppm, those are larger packages.

Ferrite beads and maybe a local regulator are also useful to keep the RF local, and the oscillator supply clean.

Options on the TCXO pin1 are also common - pull up / pull down, and even a trim pot, if you get a VCTCXO

You could also look at the new
ECS-TXO-20CSMV-AC260-AY-TR  Temperature Compensated Crystal Oscillator (TCXO) 26MHz ±0.5ppm Clipped Sinewave 4-Pin CSMD T/R

For fun, you could add a 74AHC1G4215GW   / 74AHC1G4214GW  SOT353 divider footprint to one CLK OUT, to allow you to generate 1pps for cross checking with GPS 1pps signals.
These are all great points and suggestions. Thank you so much!
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #9 on: April 26, 2023, 05:20:20 am »
@PCB.Wiz - In audio circuits, ceramic caps are avoided in the signal path, because of the possibility of vibration noise (I forget the proper name... Resonant something, maybe) Film caps are used. Would film caps be better for the DC caps in our circuit?

Here is the updated schematic, with your corrections. I am still considering your other improvement suggestions.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #10 on: April 26, 2023, 07:23:10 am »
@PCB.Wiz - In audio circuits, ceramic caps are avoided in the signal path, because of the possibility of vibration noise (I forget the proper name... Resonant something, maybe) Film caps are used. Would film caps be better for the DC caps in our circuit?
Ceramic caps are "microphonic" (that's the word you were looking for), but another reason they are eschewed in audio circuits as coupling capacitors is that most ceramic dielectrics (excluding NP0/C0G) exhibit a voltage dependance tha can cause distorsion with larger signals.

Here, this is not a worry at all, and MLCC caps are quite ideal for power decoupling, due to their very low equivalent series resistance (ESR).

For the DC blocking cap between the oscillator/TCXO that's also not a concern.

A couple of notes on the schematic:
  • You are using a 100 pF - 1 nF DC blocking capacitor, the datasheet advises a 0.1 µF one. The impedance at 25 MHz is probably OK for 1 nF (157 Ω) but not so good for 100 pF (1570 Ω). Use the recommended value.
  • The trimmer is wrongly connected. Contacts 2 and 3should be swapped. But there's no point in using a variable resistor here, just go for a fixed resistor divider providing about 1 V peak to peak - and with an impedance of few kΩ (the datasheet does not specify the impedance of the XA input, unfortunately).

Also:
Quote from: t1d
I am also aware that a 27MHz crystal will allow you to access some radio frequencies that the 25MHz will not.
How would that be?
Any input clock frequency from 25 MHz to 27 MHz will allow using the full range of the PLL (600 MHz to 900 MHz), thanks to the fractional multiplier, hence any possible final output frequency.

As already said, the need for output DC blocking capacitors depends on your needs, but take into consideration that the Si5351 has an output impedance of 50 Ω at the maximum drive level, and if you want to reach low frequencies (it can generate down to about 2.5 kHz, IIRC), 0.1 µF is too low to maintain a decent output impedance: its reactance at 2.5 kHz is ≈640 Ω.
« Last Edit: April 26, 2023, 07:24:46 am by newbrain »
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #11 on: April 27, 2023, 04:47:30 am »
Firstly, thank you, newbrain and all others, for your gracious and kind help! I am just a retired hobbyist who is trying to keep his mind learning. And, wow, y'all are great teachers. Thank you.
  • You are using a 100 pF - 1 nF DC blocking capacitor, the datasheet advises a 0.1 µF one. The impedance at 25 MHz is probably OK for 1 nF (157 Ω) but not so good for 100 pF (1570 Ω). Use the recommended value.
I corrected this back to the DS, per your instructions. I thought that PCB.Wiz had suggested these values, over the DS, in his prior post. Maybe I did not understand what he meant?
[/li]
[li]The trimmer is wrongly connected. Contacts 2 and 3should be swapped.
I corrected its orientation. I seem to have trouble remembering the proper orientation for CW rotation.
ut there's no point in using a variable resistor here, just go for a fixed resistor divider providing about 1 V peak to peak - and with an impedance of few kΩ (the datasheet does not specify the impedance of the XA input, unfortunately).[/li]
[/list]
This is just a matter of my personal preference and a little trick that I know... SMD1206 components will bridge the standard 2.54mm pin spacing that the VR uses. So, I can drop in resistors, if decide to.
Also:
Quote from: t1d
I am also aware that a 27MHz crystal will allow you to access some radio frequencies that the 25MHz will not.
How would that be?
Any input clock frequency from 25 MHz to 27 MHz will allow using the full range of the PLL (600 MHz to 900 MHz), thanks to the fractional multiplier, hence any possible final output frequency.
As I recall... This information came from an RF person that discovered a problem with tuning in a particular station. He traced the cause back to the 25MHz that came with typical modules. He stated that the issue was with how the Si5351A calculates the math. He showed the calculations in great detail. I am not a RF person, so I just made note that I would likely prefer a 27MHz, all things (cost) being equal. I do not have the link. If I come across it again, I will try to remember to get it for you.
As already said, the need for output DC blocking capacitors depends on your needs, but take into consideration that the Si5351 has an output impedance of 50 Ω at the maximum drive level, and if you want to reach low frequencies (it can generate down to about 2.5 kHz, IIRC), 0.1 µF is too low to maintain a decent output impedance: its reactance at 2.5 kHz is ≈640 Ω.
I was just using 0.1uF as a place holder. I apologize for not stating that earlier. I changed it to "TBD" (To Be Determined,) for now.

I know just enough to know that I would need to research the proper value, but not enough to know what factors are involved, or how to do the calculations. I would like enough capacitance to attain as much of the Si5351A's bandwidth capability, as possible, within reason.

Here is the current revision of the schematic. Again, thank you soooo much!
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #12 on: April 27, 2023, 08:05:04 am »
Quote from: t1d
This information came from an RF person that discovered a problem with tuning in a particular station
I found the discussion.
It's related to a very specific application and some extra self imposed requirement.

If one wants to absolutely minimize jitter, the best way is using as much as possible integer divisors in the feedback and output "multisynths".

Specifically the person in question wants to use the Si5351 as a clock generator for 2m band WSPR so for clock outputs in the 145 MHz range.
WSPR is a digital transmission mode with a very close and precise spacing between the frequency shift keying values:
https://en.wikipedia.org/wiki/WSPR_(amateur_radio_software)
(It's an incredible system, my 200 mW beacon was received at more than 8600 km, using a literal cloth wire as antenna)

What he says is that with his algorithm he can't get the exact spacing when using a 25 MHz crystal.
But this happens with his algorithm, that enforces an even divisor on the output multisynth, I also wonder if he's using the best approximating fraction rather than a fixed denominator one.

Unless you have the same very specific requirements, I really would not care.

If I have time, I'll run a simulation to see what's the maximum error with various crystals, but I manually tried a couple of values and got an error of about 0.000 000 3 Hz with an even output multysinth divider and a 25 MHz crystal (specifically, aiming for a frequency of 145 000 001.4648 Hz).

I deem that acceptable. :-DD

If I get time, now that you have picked my curiosity, I'll run a simulation to find the worse case, I might have been extra lucky.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #13 on: April 28, 2023, 02:29:07 am »
Thanks, newbrain, for letting me know that you found the RF post and there is at least some amount of validity to the author's point. I always have the concern that I might be spreading internet misinformation. You might want to post the link.

Thanks, again, for pointing out the wiring error on the trimmer. My brother explained to me that the problem is not just the CW/CCW turn orientation, but that sorting conditions can occur at the wiper extremes. That makes sense. I have a DIY 10K Bench Pot (Super-useful!!!,) so I added labels to the wires, to prevent mistakes.

I have ordered the new boards.

Cheers!

« Last Edit: April 28, 2023, 02:31:32 am by t1d »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #14 on: April 28, 2023, 05:23:28 am »
I corrected this back to the DS, per your instructions. I thought that PCB.Wiz had suggested these values, over the DS, in his prior post. Maybe I did not understand what he meant?
Yes, the 100nF data sheet value is 'quite large' in this context. If we assume a 100k RFB inside the 5351A osc, then that gives a tau of 10ms, for stable operation, which is slower than most OSC start up.
I've seen a better 1nF value used, which drops the bias stabilization time to less than most Osc startups..

Quote
but there's no point in using a variable resistor here, just go for a fixed resistor divider providing about 1 V peak to peak - and with an impedance of few kΩ (the datasheet does not specify the impedance of the XA input, unfortunately).
This is just a matter of my personal preference and a little trick that I know... SMD1206 components will bridge the standard 2.54mm pin spacing that the VR uses. So, I can drop in resistors, if decide to.
Trim pot footprint I would consider large here - this is a sensitive node and small area matters.
The divider needs to be low impedance, but not too low that it strains the TCXO out.
As a ballpark, if you select 0pF register C loading inside Si5351A, a 5pF circuit loading and 1k net impedance is a tau of 5ns

Most 'Clipped sine' outputs have a tau of appx Period/4, so are better described as well filters square waves.
eg if you pick 1k from CMOS out and 470 to GND, Vo is 1.055V p-p and that has a 5pF tau of sub 2ns and it loads the OSC to ~2.2mA
If you are driving a AC coupled XTAL amplifier, a finite rise time is actually helpful.

I would put a multi-turn trim pot footprint on the TCXO pin1 which can be VC of a VCTCXO. (or simply omitted if you enable from your MCU)

re 1V p-p :
Thank you so much for pointing that out. I just totally missed it. That scraps the board, I guess - no way to bodge it.
Don't be afraid to dead-bug and Manhattan wire to test things. :)
You can cut traces and even bend up single pins, and I've used the fine strands from inside ribbon cable, to wire fine parts for
measurement.

Good thing it was only $3.05.
I know that I own the mistake, because this detail is in the datasheet. However, isn't this oddly engineered? I would have never expected that XA's voltage in would not be equal to Vdd. And, if it is an unique engineering point, maybe it could have been more prominently highlighted in the text?
I've no idea what the actual damage value is here.
One test you could try, is to direct feed the XA to an output pin, and check for ~50% duty cycle.

It may be that SiLabs focus on the Xtal Amplifier linear region, and a classic class A N-MOSFET current fed Xtal oscillator, has ~ 1V p-p normally operating.

Addit:
Quote
... so I just made note that I would likely prefer a 27MHz, all things (cost) being equal.
keep in mind SiLabs spec'd Crystal values of 25~27MHz to keep their oscillator design and testing simple, but the CMOS design can actually accept a far wider driven clock range.
Some notes here
https://www.simonsdialogs.com/2018/11/si5351a-any-frequency-cmos-clock-generator-and-vco-specifications-myths-and-truth/
If looking for stable oscillators, by far the most common stable value [25~27MHz] is 26MHz, driven by the massive GPS market.
That's why the first part code released for the new ECS-TXO-20CSMV-AC-xx is ECS-TXO-20CSMV-AC-260-AY-TR (26MHz)

That said, I see Digikey do show a single part code for 27MHz TCXO small package, so you can test something  :  TG2016SMN 27.0000M-MCGNNM3
The ECS-TXO-20CSMV-AC-260-AY-TR is cheaper, but it can be useful comparing different parts. **
Addit 2:
I found the way-back post from NT7S comparing different vendors TCXOs, gives good clues of what to look out for.
https://nt7s.com/2016/04/si5351a-breakout-board-tcxo-upgrade/

I see NT7S has qualified two TCXO's in Mar 2021  : Jauch Quartz O 25,0-JT32C-A-K-3,3-LF or Abracon ASTX-H11-25.000MHZ-T
« Last Edit: April 29, 2023, 04:50:15 am by PCB.Wiz »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #15 on: April 29, 2023, 04:29:31 am »
PCB.Wiz - Thank you for your post. There is a good bit of information in it and it will take a little time for me to get my thoughts together.
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #16 on: April 29, 2023, 11:16:59 pm »
I greatly respect your obvious extensive knowledge and appreciate the amazing graciousness with which you share it.

Yes, the 100nF data sheet value is 'quite large' in this context. If we assume a 100k RFB inside the 5351A osc, then that gives a tau of 10ms, for stable operation, which is slower than most OSC start up.
I've seen a better 1nF value used, which drops the bias stabilization time to less than most Osc startups.
This is where the hobbyist (me) hears two really knowledgeable voices (newbrain and you.) Perhaps the two of you could come to a conclusion? In the meantime:
- I have made a note on the schematic.
- I can do some experiments to find the best value. [/quote]

Trim pot footprint I would consider large here - this is a sensitive node and small area matters.
Quote
This is a good point.
The divider needs to be low impedance, but not too low that is strains the TCXO out.
As a ballpark, if you select 0pF register C loading inside Si5351A, a 5pF circuit loading and 1k net impedance is a tau of 5ns

Most 'Clipped sine' outputs have a tau of appx Period/4, so are better described as well filters square waves.
eg if you pick 1k from CMOS out and 470 to GND, Vo is 1.055V p-p and that has a 5pF tau of sub 2ns and it loads the OSC to ~2.2mA
If you are driving a AC coupled XTAL amplifier, a finite rise time is actually helpful.
This is beyond my present knowledge base. I am still learning about impedance matching. Tau I will have to research.

I would put a multi-turn trim pot footprint on the TCXO pin1 which can be VC of a VCTCXO.
I believe that your advantage in moving the trimmer is that it will allow the TCXO to be moved closer to S15351A = Clever! However,
1) I was not confident that I understood you pin selection.
2) Are we talking about 1VACpp, or 1VDC? I would have thought that its is 1VDC, because this is a tri-state code configuration pin? If 1VDC, then that might not work, for various reasons, including the fact that Pin1 is pulled up to 3v3.
I admit that I am probably not understanding things at all. My apologies.
(or simply omitted if you enable from your MCU)

It may be that SiLabs focus on the Xtal Amplifier linear region, and a classic class A N-MOSFET current fed Xtal oscillator, has ~ 1V p-p normally operating.
Above my knowledge. Sorry.

Addit:
... so I just made note that I would likely prefer a 27MHz, all things (cost) being equal.

keep in mind SiLabs spec'd Crystal values of 25~27MHz to keep their oscillator design and testing simple, but the CMOS design can actually accept a far wider driven clock range.
Some notes here
https://www.simonsdialogs.com/2018/11/si5351a-any-frequency-cmos-clock-generator-and-vco-specifications-myths-and-truth/
If looking for stable oscillators, by far the most common stable value [25~27MHz] is 26MHz, driven by the massive GPS market.
That's why the first part code released for the new ECS-TXO-20CSMV-AC-xx is ECS-TXO-20CSMV-AC-260-AY-TR (26MHz)
Yes, I have seen some recommendations for the 26MHz crystal. Also, someone was testing a 10MHz: https://www.zachtek.com/post/2019/02/14/using-the-si5351-directly-with-a-10mhz-ocxo-for-increased-stability. I have a 10MHz OCXO and  a GPS with which to discipline it. But, that is for future development.

Addit 2:
I found the way-back post from NT7S comparing different vendors TCXOs, gives good clues of what to look out for.
https://nt7s.com/2016/04/si5351a-breakout-board-tcxo-upgrade/
I will give it a look.

Thank you, for all of your great information and ideas!
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #17 on: April 29, 2023, 11:58:00 pm »
Quote from: t1d
- To avoid level shifting, I went with a fully 3V3 system. Meaning, I will run the Si5351A, the Nano and any future display on 3V3
The Nano is 5V, and I see the new UNO 4 is also 5V, so simple level shifting might be more future proof, and opps-safe ?
Adafruit use a single SOT363 package, dual N-FET, for their i2c level shifting.  eg BSS138DW 

Tau I will have to research.
Tau is simply time constant, τ = RC
https://en.wikipedia.org/wiki/RC_time_constant
So it gives a simple ballpark number for the slow down effect that any resistive divider has into a capacitive load.
If the resistors are too high, the square wave becomes an attenuated 'triangle', if they are too low, the TCXO loading can be too great.

Quote
I would put a multi-turn trim pot footprint on the TCXO pin1 which can be VC of a VCTCXO.
1) I was not confident that I understood you pin selection.
I was maybe a bit unclear.  Pin1 varies with TCXO.
There are VCTCXO which are Voltage Controlled Temperature Corrected Xtal Osc.
The VC pin1 on those part is an analog adjustment of a few ppm, so you can fine tune an exact change.
You can connect to a multi-turn trimpot, or a DAC, to support that option.

You mentioned a 'DIY Function Generator?' - what is your final use for this ?
« Last Edit: April 30, 2023, 12:49:13 am by PCB.Wiz »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #18 on: April 30, 2023, 01:13:40 am »
I have a Rigol 822 25MHz x 2 Channels Function Generator. Just for learning purposes, I swept a coil of wire and looked for the coil's greatest resonate amplitude. I ran out of bandwidth. I am hopeful that the S15351 configuration that we are working on could serve as a very basic DIY function generator via an Arduino and additional components, or at least be the frequency source to drive such. If not, I am in the enviable position of having an excuse to by another function generator. Yes, I know that the Si5351A is just a clock source, in and of itself.

Either way, it's a win-win situation... I either learn a lot and end up with a work-around for my present bandwidth limitations. or I get another function generator. Maybe I'll do both. That seems to be the best of both worlds, to me. <grin>
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #19 on: April 30, 2023, 07:02:33 am »
I had some great success, thanks to you good folks! So, I thought I would share it...

Picture of lab and project set up


Picture of Breadboard
Red Arrow = DIY S15153A Breakout Board, buried in jumper wires.
Purple Arrow = DIY 25MHz Oscillator made from a piece cut from a flawed board. Even bad boards can be useful.
Green Arrow = Clone Nano. This was my first time to use this clone. It worked perfectly, on the first attempt..


Picture of DIY Bench Bus Bar = very handy!


See following post for scope shots...
« Last Edit: April 30, 2023, 07:38:47 am by t1d »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #20 on: April 30, 2023, 07:10:34 am »
Picture of 112.5MHz, on my 100MHz 1104X-E scope. Its warranty has expired. Time to upgrade the software to the 200MHz version. I had to increase the amplitude to get it to work.


13.553115MHz


10.706KHz


I have downloaded the Skyworks Clock Calculator. My next step is to learn how to use it to change to output frequencies.
« Last Edit: April 30, 2023, 07:16:38 am by t1d »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #21 on: April 30, 2023, 07:21:44 am »
DIY Oscillator - The black pull tab on top is a piece of heat shrink flattened with duck-bill pliers, while still warm. Super Glue was added to the PCB, before shrinking the heat shrink.


Extra unconnected pins were used to add support, for when it's installed in the breadboard.
« Last Edit: April 30, 2023, 07:42:45 am by t1d »
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #22 on: April 30, 2023, 07:44:33 am »
Hmm... The forum file downloader kept swapping the pictures around... So, pardon any mistakes. I had everything correctly, at this point, but who knows if it will hold.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #23 on: May 01, 2023, 12:07:53 am »
I had some great success, thanks to you good folks! So, I thought I would share it...
Green Arrow = Clone Nano. This was my first time to use this clone. It worked perfectly, on the first attempt..
:-+
That's good.
I've been thinking about how to calibrate a TCXO, or measure a VCTCXO on your setup.  ie compare a GPS 1pps with the OSC value, using a simple MCU, like your AVR Nano

With an 8 bit MCU and a 1pps from a GPS as one reference, you do not need to capture all 24 bits (0x00F42400), as the bottom 16 bits covers ~0.4%
A clone nano with a crystal, would be preferable to one with a ceramic resonator, as the cheapest resonator is not really stable or tight enough.
( maybe something like  https://www.aliexpress.com/item/1005003524081449.html  ?)

That leaves the Si5351 tcxo to check, inside the Si5351 a PLL output has lower kHz than a direct XTAL/R, but that limits your other design choices.
I was initially thinking to just generate a 1pps for simplicity, but that has issues too.
a) It cannot quite hit exact 1pps, even with added 2^N external. That's fixable in SW.
b) When using a 3rd frequency (the MCU clock) you want to cancel that drift if possible, so it is best to capture both GPS and TCXO/K CAL values, in largely the same window.
That means a faster capture/interrupt, that is then 'nearest-aligned' with the 1pps gives best MCU drift rejection.

The Si5351 XO direct out path R divider can be 1~128 in binary steps, so some scaling is possible.

Using an external 74AHC1G4215, we can get capture edges (XO/K) at ~6Hz~763Hz, or a  74AHC1G4214 is ~12Hz~1526Hz or 74AHC1G4212  is ~48Hz~6103Hz, all SW tolerable rates.

On a 8b MCU at 16MHz, the divider chain for a close to 1s capture window, is R=32, B=2^12 gives 190.7348633Hz Capture rate and a byte sized /190 counter accepts only every 190 readings, for a calibrate every second refresh.
The Sw counter is re-set by the GPS 1pps capture, so the 1s sampling windows are 99% overlapped, to cancel MCU Xtal drift.
LSB calibrate in this 1s case, is ~62.5ppb.
Better LSB precision is possible with longer capture times, eg an 11s calibrate/capture frame has virtual captures of  GPS= 0x0A7D8C00, 25MHz.XO/(32*2^12*2098) =0x0A7D70A3
Only the lower 16bits are needed here. LSB is ~5.7ppb.
The same-window alignment here is within one part in 2098, so a (smooth) 2ppm xtal drift in 11 seconds, is rejected to ~1ppb LSB.
 

Offline t1dTopic starter

  • Super Contributor
  • ***
  • Posts: 1220
  • Country: us
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #24 on: May 01, 2023, 01:40:36 am »
I had some great success, thanks to you good folks! So, I thought I would share it...
Green Arrow = Clone Nano. This was my first time to use this clone. It worked perfectly, on the first attempt..
:-+
That's good.
I've been thinking about how to calibrate a TCXO, or measure a VCTCXO on your setup.  ie compare a GPS 1pps with the OSC value, using a simple MCU, like your AVR Nano

Snip
That is all quite impressive and interesting, PCB.Wiz!

My knowledge base is not so extensive, in these regards. However, here are some things that I realized, when I was considering building a GPS Disciplined OCXO 10MHz Standard Reference and they might apply to your considerations, as well...

If I understand correctly,
The processing speed of a MCU is effected by two things... a) the number of cycles it takes to complete an operation and 2) the frequency of its source oscillator.
PIC MCUs seem to be able to use faster oscillators than the Arduino 328 types. The fastest I recall specified for the PICs is 48Mhz. However, a PIC requires four cycles to complete an operation, where a 328 only requires one. Do I have this correctly?

The YouTuber "Scullcom Hobby Electronics" has a complete DIY GPSDO 10MHz Reference Standard build, using an Arduino and a Ublox GPS clone. Part of his trick is to use one of the newer series Ublox clones (v6 and above, IIRC. vM8N has better options.) which has a SW adjustable output frequency. There are two problems with this trick:
1) The GPS NMEA signal only provides a 1PPS signal. It is the Ublox that is doing the multiplication to 10MHz. Whatever flaws/noise/thermal drift the Ublox contributes are included in the 10MHz output.
2) The multiplication method that the Ublox uses does not land evenly on some multiples. Those multiples end up having a good bit of jitter added to them. 10MHz is one of those multiples. There might be ways to remove the jitter, but it is better for it to not have been added in, in the first place. IIUC your thoughts, you will use the NMEA 1PPS signal to trigger the MCU to count, compare the count to 10M (or whatever) and adjust the oscillator (or whatever,) accordingly. That is the same solution that I was thinking of. But, the coding is beyond me.

LOL... I think I just high-jacked my own thread! So, I will call this thread successfully solved. Thank you, so much, to all of you that participated and helped!
« Last Edit: May 01, 2023, 01:46:34 am by t1d »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Windows Freeware GUI for Si5351A DIY Function Generator?
« Reply #25 on: May 01, 2023, 02:41:25 am »
If I understand correctly,
The processing speed of a MCU is effected by two things... a) the number of cycles it takes to complete an operation and 2) the frequency of its source oscillator.
PIC MCUs seem to be able to use faster oscillators than the Arduino 328 types. The fastest I recall specified for the PICs is 48Mhz. However, a PIC requires four cycles to complete an operation, where a 328 only requires one. Do I have this correctly?
Broadly, yes. Not all opcodes take the same time tho. For capture timing, you usually use inbuilt timers, so the opcode time matters less.

The YouTuber "Scullcom Hobby Electronics" has a complete DIY GPSDO 10MHz Reference Standard build, using an Arduino and a Ublox GPS clone. Part of his trick is to use one of the newer series Ublox clones (v6 and above, IIRC. vM8N has better options.) which has a SW adjustable output frequency. There are two problems with this trick:
1) The GPS NMEA signal only provides a 1PPS signal. It is the Ublox that is doing the multiplication to 10MHz. Whatever flaws/noise/thermal drift the Ublox contributes are included in the 10MHz output.
2) The multiplication method that the Ublox uses does not land evenly on some multiples. Those multiples end up having a good bit of jitter added to them. 10MHz is one of those multiples. There might be ways to remove the jitter, but it is better for it to not have been added in, in the first place.
That's an interesting approach, it scores high for simplicity, as it simply redefines the 1pps output, but if you want 10.00MHz it is less ideal as all edges are 48MHz derived, and so jitter is significant.
In 500ns you have 24 x 48MHz cycles, or an average of 5 x 10MHz cycles.
I did find this,
https://hackaday.io/project/11263-gps-locked-10mhz-lab-frequency-reference/log/37615-project-completed
That uses a 10MHz crystal to 'ring' at 10MHz with very high Q, which lowers the phase jitter significantly.
The average over 500ns / 5 full periods is correct, so the HiQ filter only has to average ok over 5 periods.

I did find this too, which suggests even 24MHz OUT is possible, for that GPS module brand, - perhaps that could feed into the Si5531 directly ?
Some very detailed tests by Russian hobbyists found that the internal NCO used to generate these output clock signals could only produce useful low jitter GPS-referenced clocks at certain clock speeds (i.e. output frequencies). Specifically, only outputs generated at 24.0, 16.0, 12.0, 8.0, 6.0, 4.0, 3.0 and 2.0 MHz could provide anything like a suitable signal. You will note that the three highest frequencies are actually outside the u-Blox specification but they still work successfully.

IIUC your thoughts, you will use the NMEA 1PPS signal to trigger the MCU to count, compare the count to 10M (or whatever) and adjust the oscillator (or whatever,) accordingly. That is the same solution that I was thinking of. But, the coding is beyond me.
Broadly, yes. You use the timer capture feature of the MCU on two simultaneous channels, one captures the GPS and the other captures the divided TCXO (partly divided by Si5351 /R and partly external HW divide tiny logic 74AHC1G4212. Once you are slower than ~1ms edges, software counting within the MCU can align/discard the captures, and the difference is the ppb error.
That works with standard building blocks.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf