Skip to content

Commit 49690d6

Browse files
authored
Merge pull request #46 from etherkit/v2.0.4
Fix error in VCXO algorithm
2 parents a9ba538 + 84ca6b2 commit 49690d6

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ PLLA and PLLB are set to 800 MHz (also defined as _SI5351_PLL_FIXED_ in the libr
249249

250250
All CLK outputs are set to 0 Hz and disabled.
251251

252+
Default drive strength is 2 mA on each output.
253+
252254
Constraints
253255
-----------
254256
* Two multisynths cannot share a PLL with when both outputs are >= 100 MHz. The library will refuse to set another multisynth to a frequency in that range if another multisynth sharing the same PLL is already within that frequency range.
@@ -663,6 +665,10 @@ This library does not currently support the spread spectrum function of the Si53
663665

664666
Changelog
665667
---------
668+
* v2.0.4
669+
670+
* Fix error in VCXO algorithm
671+
666672
* v2.0.3
667673

668674
* Fix regression in _set_freq()_ that wiped out proper R div setting, causing errors in setting low frequency outputs

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Etherkit Si5351
2-
version=2.0.3
2+
version=2.0.4
33
author=Jason Milldrum <milldrum@gmail.com>
44
maintainer=Jason Milldrum <milldrum@gmail.com>
55
sentence=A full-featured library for the Si5351 series of clock generator ICs from Silicon Labs

src/si5351.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ void Si5351::set_vcxo(uint64_t pll_freq, uint8_t ppm)
11971197
delete params;
11981198

11991199
// Write the VCXO parameters
1200-
vcxo_param = (vcxo_param * ppm) / RFRAC_DENOM;
1200+
vcxo_param = ((vcxo_param * ppm * SI5351_VCXO_MARGIN) / 100ULL) / 1000000ULL;
12011201

12021202
temp = (uint8_t)(vcxo_param & 0xFF);
12031203
si5351_write(SI5351_VXCO_PARAMETERS_LOW, temp);
@@ -1319,7 +1319,7 @@ uint64_t Si5351::pll_calc(uint64_t freq, struct Si5351RegSet *reg, int32_t corre
13191319

13201320
if(vcxo)
13211321
{
1322-
return (uint64_t)(128 * a * SI5351_VCXO_MARGIN + b * SI5351_VCXO_MARGIN);
1322+
return (uint64_t)(128 * a * 1000000ULL + b);
13231323
}
13241324
else
13251325
{

src/si5351.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#define SI5351_MULTISYNTH_P3_MAX ((1<<20)-1)
7070
#define SI5351_VCXO_PULL_MIN 30
7171
#define SI5351_VCXO_PULL_MAX 240
72-
#define SI5351_VCXO_MARGIN 1030000
72+
#define SI5351_VCXO_MARGIN 103
7373

7474
#define SI5351_DEVICE_STATUS 0
7575
#define SI5351_INTERRUPT_STATUS 1

0 commit comments

Comments
 (0)