-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big commit due lost of sync with local repo, sorry
- Loading branch information
1 parent
f81f45d
commit cde329a
Showing
8 changed files
with
354 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Si5351mcu Changelog File # | ||
|
||
## v0.2rc (April 23, 2017) ## | ||
|
||
* Added power level support for each output independently, watch out!: setting the power level will enable the output. | ||
* Set default power to the lowest one (2mA) from the maximun possible (8mA). | ||
* Fixed the need for a reset after each correction, it does it now automatically | ||
* Added a init function to pass a custom xtal | ||
* Modified the example to show no need for a init unless you use a different xtal | ||
* Improved the keywords.txt file to improve edition on the Arduino IDE | ||
* Included a "features" section on the README.md | ||
|
||
## v0.1rc (April 20, 2017) ## | ||
|
||
* Added enable(), disable() and off() functions. | ||
* Added support for handling all the three outputs of the Si5351A, (CLK1 & CLK2 are mutually-exclusive) | ||
* Updated the example with the new functions. | ||
* Improved library logic by reusing and optimizing functions. | ||
* Improved the documentation and comments (lib code, README and example) | ||
* The compiled code is slightly smaller now (~1% on an ATMega328p) | ||
* Added Changelog and version files. | ||
* Extensive tests made to validate every function. | ||
|
||
|
||
## Initial Release, v0.0 (April 9, 2017) ## | ||
|
||
* Basic functionality. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
# Arduino Si5351 Library tuned for size and click free. # | ||
# Arduino Si5351 Library tuned for size and click noise free. # | ||
|
||
This library is tuned for size and MCU operation, it will control only CLK0 and CLK1 outputs (for now). | ||
This library is tuned for size on the Arduino (MCU) platform, it will control CLK0, CLK1 and CLK2 outputs for the Si5351A (the version with just 3 clocks out). | ||
|
||
It's click free, with some provisions, keep readding | ||
But there is not such thing as free lunch: please read the *Two of three* section below; and sure it's click free with some provisions, keep reading. | ||
|
||
## Inspiration ## | ||
|
||
This work is based on the previous work of these people: | ||
This work is based on the previous work of these great people: | ||
|
||
* [www.etherkit.com](https://www.etherkit.com) the full featured lib, with big code as well. | ||
* [QRP Labs demo libs](http://qrp-labs.com/synth/si5351ademo.html) the smallest and simple ones on the net. | ||
* [DK7IH demo code](https://radiotransmitter.wordpress.com/category/si5351a/) the first click-less code on the wild. | ||
* [Etherkit/NT7S:](https://github.com/etherkit/Si5351Arduino) The mainstream full featured lib, with big code as well. | ||
* [QRP Labs demo code:](http://qrp-labs.com/synth/si5351ademo.html) The smallest and simple ones on the net. | ||
* [DK7IH demo code:](https://radiotransmitter.wordpress.com/category/si5351a/) The first clickless noise code on the wild. | ||
|
||
## Click-less ## | ||
## Features ## | ||
|
||
This are so far the implemented features (Any particular wish? use the Issues tab for that): | ||
|
||
* Custom XTAL passing on init (default is 27.0MHz) | ||
* You are able to pass a correction to the xtal while running (as for your own calibration procedure) | ||
* You have a fast way to power off all outputs of the Chip. | ||
* You can enable/disable any output at any time. | ||
* You can only have 2 of the 3 outputs running at any moment, see "Two of three" below. | ||
* It's free of click noise while you move on frequency. | ||
* **NEW!** Power control on each output independently (see setPower(clk, level) on the lib header, initial default is to lowest level: 2mA) | ||
|
||
## Click noise free ## | ||
|
||
The click noise while tunning the chip came from the following actions (stated in the datasheet & app notes): | ||
|
||
|
@@ -28,24 +40,38 @@ In my tests I can move across several Mhz (1 to 10, 28 to 150) without getting o | |
|
||
## The start sequence is important ## | ||
|
||
Yes, in your setup() code segment you must initialize it in the following sequence: | ||
Yes, in your setup code segment you must initialize it in the following sequence: | ||
|
||
* Apply correction factor (if needed) | ||
* (Optional) power off all outputs | ||
* Set sweet spots frequencies to **both** clock outputs | ||
* Force a reset of the PLLs. | ||
|
||
In the example code you can see this inside the setup function: | ||
Here you have an example code of what I mean ("Si" is the lib instance): | ||
|
||
``` | ||
setup() { | ||
(... my great code here ...) | ||
////////////////////////////////// | ||
// Si5351 functions | ||
////////////////////////////////// | ||
// apply my calculated correction factor | ||
pll.correction(-1250); | ||
Si.correction(-1250); | ||
// Optional, power off all outputs until needed | ||
Si.off(); | ||
// set some freqs | ||
pll.setFreq(0, 25000000); // CLK0 output | ||
pll.setFreq(1, 145000000); // CLK1 output | ||
// set some sweet spot freqs | ||
Si.setFreq(0, 25000000); // CLK0 output | ||
Si.setFreq(1, 145000000); // CLK1 output | ||
// force the first reset | ||
pll.reset(); | ||
Si.reset(); | ||
(... other great code here ...) | ||
} | ||
``` | ||
|
||
|
@@ -54,51 +80,39 @@ When I write "sweet spots frequencies" I write about some middle frequencies in | |
For example if you use CLK0 for VFO and CLK1 for BFO for a 40m receiver with 10 Mhz IF and upper injection I will suggest this code segment in your setup: | ||
|
||
``` | ||
// apply my calculated correction factor | ||
pll.correction(-1250); | ||
// set some freqs | ||
pll.setFreq(0, 17150000); // VFO 7.150 Mhz (mid band) + 10.0 Mhz | ||
pll.setFreq(1, 10000000); // BFO 10.0 Mhz | ||
// set some sweet spot freqs | ||
Si.setFreq(0, 17150000); // VFO 7.150 Mhz (mid band) + 10.0 Mhz | ||
Si.setFreq(1, 10000000); // BFO 10.0 Mhz | ||
// force the first reset | ||
pll.reset(); | ||
Si.reset(); | ||
``` | ||
|
||
## Normal operation ## | ||
|
||
After the setup process you can setup any freq to any of the two outputs (CLK0 or CLK1) via the setFreq(CLK, FREQ) procedure as usual. | ||
|
||
If you get in trouble (freq not in the exact spot, or other weird things) after moving in steps of more than 10 Mhz or in the lower edge of the coverage (below 3 Mhz) just make a **single** reset() and all will be ok again. This just happened one time to me in the dev process so far, in the present code I don't see this effect any more, but I mentioned it "just in case". | ||
|
||
If you found a trouble like this I would like to hear about it to try to fix that, this is beta code and is the first iteration, it may contain some bugs or typos. | ||
If you need to apply/vary the correction factor **after** the setup process you will get a click noise on the next setFreq() to apply the changes. | ||
|
||
If you need to apply/vary the correction factor **after** the setup process (like in a own calibration routine) you will get a click noise on the next setFreq() to apply the changes, so, if you do it repeatedly it will have click noise on it, that perfectly normal. | ||
## Two of three ## | ||
|
||
## Installation ## | ||
Yes, there is a tittle catch here with CLK1 and CLK2: both share PLL_B and as we use math to produce an integer division you can only use one of them at a time. | ||
|
||
Just go to the [Github repository page (this page)](https://github.com/pavelmc/Si5351mcu/) and click on the "Clone or Download" green button, select download and download it to your PC. | ||
Note: _In practice you can, but the other will move from the frequency you set, which is odd, so I made them mutually exclusive._ | ||
|
||
The file name will be like this: Si5351mcu-master.zip, you must extract the files and put them in a folder called "Si5351mcu" inside your "Libraries" arduino folder. | ||
This are the valid combinations for independent clocks output. | ||
|
||
Restart your Arduino IDE software and that's all. | ||
* CLK0 and CLK1 | ||
* CLK0 and CLK2 | ||
|
||
## Assumptions ## | ||
|
||
This lib assume this facts: | ||
|
||
* The Si5351 is set to put a 8 pF across the XTAL. | ||
* The CLK outputs are set to full power (8 mA over 50 ohms) | ||
* At the moment the CLK2 will not be used. | ||
Again: You can't use CLK1 and CLK2 at the same time, as soon as you set one of them the other will shut off. That's why you get two of three and one of them must be always CLK0. | ||
|
||
## Author & contributors ## | ||
|
||
The only author is Pavel Milanes, CO7WT, reachable at [email protected], contributors and sponsors are welcomed. | ||
The only author is Pavel Milanes, CO7WT, a cuban amateur radio operator; reachable at [email protected], Until now I have no contributors or sponsors. | ||
|
||
## Where to download the latest version? ## | ||
|
||
Always download the latest version from the [Github repository](https://github.com/pavelmc/Si5351mcu/) | ||
Always download the latest version from the [github repository](https://github.com/pavelmc/Si5351mcu/) | ||
|
||
See ChangeLog.md on this repository to know what are the latest changes. | ||
|
||
## If you like to give thanks... ## | ||
|
||
|
@@ -111,4 +125,4 @@ If you like to do so, please go to Ding, select Cuba, select Cubacell (for phone | |
* For phone topup use this number (My cell, feel free to call me if you like): +53 538-478-19 | ||
* For internet time use this user: [email protected] (that's not an email but an user account name) | ||
|
||
Thanks before hand. | ||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
Si5351mcu KEYWORD1 | ||
|
||
init KEYWORD2 | ||
correction KEYWORD2 | ||
12cWrite KEYWORD2 | ||
i2cWrite KEYWORD2 | ||
reset KEYWORD2 | ||
setFreq KEYWORD2 | ||
enable KEYWORD2 | ||
disable KEYWORD2 | ||
setPower KEYWORD2 | ||
|
||
XTAL LITERAL1 | ||
SIXTAL LITERAL1 | ||
SIADDR LITERAL1 | ||
SIOUT_2mA LITERAL1 | ||
SIOUT_4mA LITERAL1 | ||
SIOUT_6mA LITERAL1 | ||
SIOUT_8mA LITERAL1 | ||
SICLK0_R LITERAL1 | ||
SICLK12_R LITERAL1 |
Oops, something went wrong.