Skip to content

Commit b5ac494

Browse files
authored
Merge pull request #99 from conr2286/Si5351-init-does-not-initialize-the-ref_freq-]-nor-corr-]-entries-for-CLKIN-#98
Si5351 init does not initialize the ref freq ] nor corr ] entries for clkin #98
2 parents b516084 + f71816a commit b5ac494

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/si5351.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,21 @@ bool Si5351::init(uint8_t xtal_load_c, uint32_t xo_freq, int32_t corr)
8282
// Set crystal load capacitance
8383
si5351_write(SI5351_CRYSTAL_LOAD, (xtal_load_c & SI5351_CRYSTAL_LOAD_MASK) | 0b00010010);
8484

85-
// Set up the XO reference frequency
85+
// Set up the XO and CLKIN reference frequencies
8686
if (xo_freq != 0)
8787
{
8888
set_ref_freq(xo_freq, SI5351_PLL_INPUT_XO);
89+
set_ref_freq(xo_freq, SI5351_PLL_INPUT_CLKIN); //Also CLKIN
8990
}
9091
else
9192
{
9293
set_ref_freq(SI5351_XTAL_FREQ, SI5351_PLL_INPUT_XO);
94+
set_ref_freq(SI5351_XTAL_FREQ, SI5351_PLL_INPUT_CLKIN); //Also CLKIN
9395
}
9496

95-
// Set the frequency calibration for the XO
97+
// Set the frequency calibrations for the XO and CLKIN
9698
set_correction(corr, SI5351_PLL_INPUT_XO);
99+
set_correction(corr, SI5351_PLL_INPUT_CLKIN);
97100

98101
reset();
99102

0 commit comments

Comments
 (0)