Skip to content

Commit

Permalink
Final touch for v0.5 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevPavelmc committed Feb 9, 2018
1 parent 28bfd81 commit efb00f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Feature: All integer math now, induced error must be at worst +/- 2 Hz.
* Feature: Clock status via clkOn[clk] public var.
* Bug Fix: Output divider low limit safe guard in place (it make some trouble under some circumstances)
* New super simple example.

## v0.4 (August 2, 2017) ##
Expand Down
14 changes: 10 additions & 4 deletions src/si5351mcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ void Si5351mcu::setFreq(uint8_t clk, unsigned long freq) {
// With 900 MHz beeing the maximum internal PLL-Frequency
outdivider = 900000000 / freq;

// If output divider out of range (>900) use additional Output divider
while (outdivider > 900) {
R = R * 2;
outdivider = outdivider / 2;
// If output divider out of range
if (outdivider < 6) { // low: below 6
// no go, this will no work.
return;
} else { // high: above 900
// use additional Output divider ("R")
while (outdivider > 900) {
R = R * 2;
outdivider = outdivider / 2;
}
}

// finds the even divider which delivers the intended Frequency
Expand Down

0 comments on commit efb00f4

Please sign in to comment.