22 * si5351_calibration.ino - Simple calibration routine for the Si5351
33 * breakout board.
44 *
5- * Copyright 2015 - 2017 Paul Warren <pwarren@pwarren.id.au>
5+ * Copyright 2015 - 2018 Paul Warren <pwarren@pwarren.id.au>
66 * Jason Milldrum <milldrum@gmail.com>
77 *
88 * Uses code from https://github.com/darksidelemm/open_radio_miniconf_2015
@@ -40,7 +40,7 @@ void setup()
4040 si5351.init (SI5351_CRYSTAL_LOAD_8PF, 0 , 0 );
4141
4242 // Start on target frequency
43- si5351.set_correction (cal_factor);
43+ si5351.set_correction (cal_factor, SI5351_PLL_INPUT_XO );
4444 si5351.set_pll (SI5351_PLL_FIXED, SI5351_PLLA);
4545 si5351.set_freq (target_freq, SI5351_CLK0);
4646}
@@ -88,7 +88,7 @@ static void vfo_interface(void)
8888 Serial.print (F (" Calibration factor is " ));
8989 Serial.println (cal_factor);
9090 Serial.println (F (" Setting calibration factor" ));
91- si5351.set_correction (cal_factor);
91+ si5351.set_correction (cal_factor, SI5351_PLL_INPUT_XO );
9292 si5351.set_pll (SI5351_PLL_FIXED, SI5351_PLLA);
9393 Serial.println (F (" Resetting target frequency" ));
9494 si5351.set_freq (target_freq, SI5351_CLK0);
@@ -114,7 +114,7 @@ static void vfo_interface(void)
114114 }
115115
116116 cal_factor = (int32_t )(target_freq - rx_freq) + old_cal;
117- si5351.set_correction (cal_factor);
117+ si5351.set_correction (cal_factor, SI5351_PLL_INPUT_XO );
118118 si5351.set_pll (SI5351_PLL_FIXED, SI5351_PLLA);
119119 si5351.pll_reset (SI5351_PLLA);
120120 si5351.set_freq (target_freq, SI5351_CLK0);
0 commit comments