Sunday 26 August 2018

Calibration of the Si5351 DDS

Each Si5351 module has a different crystal, whose frequency may not be exactly the 25MHz needed for exact output frequencies. But the Si5351 has the capability to compensate for that using a CALIBRATION value in your sketches. For example,

#define CALIBRATION 29000  // frequency CALIBRATION

#define FREQMIN 10000000
#define FREQMAX 15000000000

Si5351 dds;
Rotary enc = Rotary(CLK, DT);

uint64_t freq = 710000000;
uint64_t freqStep = 1000000;

void setup() {
  pinMode(CLK, INPUT_PULLUP);
  pinMode(DT, INPUT_PULLUP);
  pinMode(SW, INPUT_PULLUP);

  oled.begin();

  // set xtal capacitance, 25MHz, & CALIBRATION

  dds.init(SI5351_CRYSTAL_LOAD_8PF, 0, CALIBRATION);
  dds.drive_strength(SI5351_CLK0, SI5351_DRIVE_8MA);
  dds.output_enable(SI5351_CLK0, 1);
  dds.set_freq(freq, SI5351_CLK0);
Shows the CALIBRATION figure of 29000 used to compensate for the crystal in the "dds.init()...)" function.

7 Experiments S 001

But the question is how to find out the value of the CALIBRATION constant. The solution I have used is very simple. Tune a radio to BBC5Live on medium wave, at 909kHz. Then set the Si5351 to output what it thinks is 910kHz. This should create a 1000Hz beat tone on the radio.

Next install the WSJT-X program on your computer. This has a spectrum analyser for audio frequencies. Chose as an audio input your PC microphone and make sure it can hear your Radio. It will show the frequency of the beat tone as an input signal. Now change the CALIBRATION figure to bring the audio signal to exactly 1000Hz on the spectrum analyser. To do this you will have to edit your sketch, put in a new number, then upload to see the result. I suggest you start in 5000 steps and then as you get closer reduce to 1000, and 500.

No comments: