Si5351 Clock Generator - Chatter, Pops and Clicks

Hello! I am using this library (GitHub - etherkit/Si5351Arduino: Library for the Si5351 clock generator IC in the Arduino environment) with an Arduino MEGA, and the SI5351 to create a clock signal that is controlling a BBD chip. So far the code is working great but I have run into a click or pop that I can't get rid of.

I have noticed that when the clock frequency passes over a value like 128000, 64000, 32000, 16000, 8000, 4000 etc there is a audible pop that I can't seem to remove. Here is my process to dial this in.

clockRaw = analogRead(A0);
clockFreq = map(depthRaw, 0, 1023, 63999, 64001);
clockFreq = clockFreq * 200;
si5351.set_freq(clockFreq_4, SI5351_CLK0);

By selecting such a narrow window with the map I'm able to consistently make the module pop. The same goes if I were to select:

clockFreq = map(depthRaw, 0, 1023, 31999, 32001);
clockFreq = map(depthRaw, 0, 1023, 15999, 16001);
clockFreq = map(depthRaw, 0, 1023,  7999,   8001);

I've tried everything I can think of to avoid this tiny piece of data and nothing is working. I tried this code below and as soon as the value got on the other side it popped again.

    if (clockFreq_1 < 63999) {
      si5351.set_freq(clockFreq_4, SI5351_CLK0);
    }
    if ((clockFreq_1 >= 63999) && (clockFreq_1 <= 64001)) {
      // DO NOTHING
    }
    if (clockFreq_1 > 64001) {
      si5351.set_freq(clockFreq_4, SI5351_CLK0);
    }

I imagine there is a buffer that is filling up and once it gets past these key multipliers it is resetting or something.

Here is some very simplified code. This does everything that I would need but when you get on top of 8/16/32/64/128 it chatters away like a geiger counter. If any of you know how I can resolve this, please let me know. I'm more than happy to pay you for you time.

All the best!

#include <si5351.h>
Si5351 si5351;

int  loveHertzRaw;
long loveHertz;

void setup()
{
  si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0); // ADDRESS is 0x61 or 97
}

void loop()
{
  loveHertzRaw = analogRead(A0);
  loveHertz = map(loveHertzRaw,0,1023,18000,200000); // 4.000kHz minimum
  loveHertz = loveHertz * 100;
  si5351.set_freq(loveHertz, SI5351_CLK0);
}  

Try making loveHertzRaw an uint32_t, so the map has a chance to work.

On 8 bit Arduinos ints have only 16 bits.

Hi,
BBD = Bucket Brigade Device (Audio Delay)
Can you please post a circuit diagram?

Do you have an oscilloscope?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:
PS, Assume we know nothing about your hardware.

Are you using this library : https://github.com/etherkit/Si5351Arduino ?

Try printing out the values that you are sending to the clock gen.

Hi,
@JacksonAudio or @MarshallPlexi , what is going on, who's project is it?

Tom.... :smiley: :+1: :coffee: :australia:

Well, you had to provide usernames for them. Wasn't that a tip?

Tried changing loveHertzRaw to type uint32_t and no change.

I should also mention that on line 67 of si5351.cpp I added:

Wire.setClock(400000L);

That changed the intensity of the POP. That leads me to believe that I am dealing with an I2C issue. Thoughts?

Found this here and it's super interesting. I think this may be what is happening. Read the last paragraph: https://www.qrp-labs.com/synth/si5351ademo.html

A note on Low Frequency operation
The limits of the Si5351A configuration registers for the fractional PLL multiplier and the Multi-Synth divider means that you need to make some small changes if you wish to generate lower frequencies, in the range 8kHz to 1MHz. In order to generate lower frequencies you must use the final division stage, which is configurable to divide by 8 powers of 2 from 0 (divide-by-1) which is the default, to 7 (divide-by-128).

In the example code above you will see the call to the function setupMultisynth passes a parameter "SI_R_DIV_1". This is a constant defined in the .h file to set the final state to divide-by-1, the default state. You can change this to SI_R_DIV_2, or SI_R_DIV_4 etc up to SI_R_DIV_128. There are 8 possible division ratios: 1, 2, 4, 8, 16, 32, 64, 128. In this case you setup a frequency the multiple higher than you really want, and then divide it back again using this division ratio.

For example, suppose you want to generate an output frequency of 136kHz. This is a lot lower than 1MHz and the Si5351A cannot reach it directly. So you use the final division stage, by passing the parameter SI_R_DIV_8 into the function call setupMultisynth instead of SI_R_DIV_1. Then you call the function si5351ASetFrequency with 1088000Hz (1.088MHz), which is 8x the desired 136kHz output.

It should be noted that although the datasheet specifies that the lowest Si5351A output frequency is 8kHz, the register configurations do allow you to configure lower values, all the way down to 3.5kHz; and it DOES work.

Hi,
What range of clock frequencies for the BBD are you aiming for?

Tom... :smiley: :+1: :coffee: :australia:

Ultimate I need to see 12.5kHz - 100kHz at the input of the BBD. To get this I have to output a freq between 25kHz - 200kHz because the CD4047 will half the input freq.

Hi,
12.5kHz to 100kHz with a device capable of 200MHz???
Did you google;

arduino frequency generator

And find this?
https://create.arduino.cc/projecthub/mircemk/diy-simple-square-wave-generator-up-to-1mhz-231375

This is a simple square-wave generator that basically uses the TimerOne library allow you to generate a PWM signal at pin 9 in the range from about 5Hz to 1 Mhz, and you can adjust the duty cycle from 0 to 100%.

Tom... :smiley: :+1: :coffee: :australia:

I'll go you one better than that! I was using this library which let's you use ANY Timer on your Arduino as a high speed timer.

https://code.google.com/archive/p/arduino-pwm-frequency-library/downloads

I was using that for this exact same idea and it was working GREAT until I noticed that it was dropping clock cycles causing an even worse popping and clicking than I was getting with the Si5351. If I could have made a go of that library I'd be more than happy. It could handle the steady state clock signal just fine, but as soon as you modulate the clock signal it would start losing cycles.

Problem Solved! Not by using the Etherkit library but by using the Adafruit one and varying the scaler!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.