Well, the problem runs much deeper. There's something going on here that I can induce through software. I noticed a LOT of spurious output when I listened to the Si5351 output on my HF receiver and decided to connect it to my homebuilt SA. See the attached BAD signal image. It looks like there’s horrible jitter, but at very regular periods. The tallest peak is at appx 8.957MHz and the others are regularly spaced at appx 31kHz intervals. The barely visible smaller peak nested inside the pattern is from my 9MHz signal generator that is multiplexed with the Si5351 signal. Ignore the ugly ripple at the tops of the peaks – that’s just artifacts from my poorly tuned 30kHz resolution filter.
What’s even weirder, depending on my code, I can get clean output from my Si5351 board. See the CLEAN signal image attached, taken at the same vertical (dB) and horizontal (frequency) scale, but with it better centered. Notice the single peak. Again, the faint nested peak is multiplexed from my 9MHz signal generator.
I’ve done a lot of software trials between the Adafruit and Etherkit libraries and, depending on which library I use,
I can turn the problem on and off.
For example, using this code with the “Adafruit_SI5351.h” library to generate a 9,004,392 Hz signal on CLK0, I get a CLEAN signal
#include <Adafruit_SI5351.h>
#include <asserts.h>
#include <errors.h>
Adafruit_SI5351 clockgen = Adafruit_SI5351();
void setup() {
if (clockgen.begin() != ERROR_NONE)
{
/* There was a problem detecting the IC ... check your connections */
while(1);
}
clockgen.setupPLL(SI5351_PLL_A, 35, 1, 7);
clockgen.setupMultisynth(0, SI5351_PLL_A, 97, 4, 7);
clockgen.enableOutputs(true);
}
void loop() {
}
However, using this code with the commonly used Etherkit Si5351 library (it's the one Charlie Morris uses on his YouTube channel), I get the BAD output -
but not right away (see below)
#include <si5351.h>
Si5351 si5351;
void setup() {
si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
si5351.set_freq((9000000 * 100ULL), 0);
}
void loop() {
}
By 'not right away' what I mean is, immediately after compiling and uploading this code, the Arduino goes to a reset and I get a CLEAN signal. But after I cycle power (meaning just unplug and replug in the USB cable to the PC), I get BAD output. And it stays BAD until I reload the Adafruit code which restores a CLEAN signal. And...with the Adafruit code loaded, I can power it up and down multiple times and the signal remains CLEAN.
For the Adafruit code I've tried many different frequencies and integer versus fractional modes and it consistently works fine. I've also played around with the CRYSTAL_LOAD values in the Etherkit init statement (by default the Adafruit uses 10pF) and the oscillator frequency and offset parameters - nothing fixes the issue.
At this point I’ve got two explanations for the problem:
(1) my board is bad and I need to trash it, which is a bummer because I bought it from Digikey so I doubt it would be counterfeit, and they are out of stock everywhere I look so getting a replacement is impossible at the moment.
(2) there is some deeply buried error in the Etherkit library and I am the first (huh??) to ever find it.
Looking for some more suggestions please, something more sane than my second explanation. At the moment I am just
![Banging Head |O](https://www.eevblog.com/forum/Smileys/default/bangheadonwall.gif.pagespeed.ce.8iLbFYV4Bc.gif)
Thanks