Adafruit Si5351 Library
|
SI5351 class. More...
#include <Adafruit_SI5351.h>
Public Member Functions | |
Adafruit_SI5351 (void) | |
SI5351 object. More... | |
err_t | begin (TwoWire *theWire=&Wire) |
Initializes I2C and configures the breakout (call this function before doing anything else) More... | |
err_t | setClockBuilderData (void) |
Configures the Si5351 with config settings generated in ClockBuilder. You can use this function to make sure that your HW is properly configure and that there are no problems with the board itself. More... | |
err_t | setupPLL (si5351PLL_t pll, uint8_t mult, uint32_t num, uint32_t denom) |
Sets the multiplier for the specified PLL. More... | |
err_t | setupPLLInt (si5351PLL_t pll, uint8_t mult) |
Sets the multiplier for the specified PLL using integer values. More... | |
err_t | setupMultisynth (uint8_t output, si5351PLL_t pllSource, uint32_t div, uint32_t num, uint32_t denom) |
Configures the Multisynth divider, which determines the output clock frequency based on the specified PLL input. More... | |
err_t | setupMultisynthInt (uint8_t output, si5351PLL_t pllSource, si5351MultisynthDiv_t div) |
Configures the Multisynth divider using integer output. More... | |
err_t | enableSpreadSpectrum (bool enabled) |
Enables or disables spread spectrum. More... | |
err_t | enableOutputs (bool enabled) |
Enables or disables all clock outputs. More... | |
err_t | setupRdiv (uint8_t output, si5351RDiv_t div) |
SI5351 class.
Adafruit_SI5351::Adafruit_SI5351 | ( | void | ) |
SI5351 object.
Constructor
err_t Adafruit_SI5351::begin | ( | TwoWire * | theWire = &Wire | ) |
Initializes I2C and configures the breakout (call this function before doing anything else)
theWire | The I2C (Wire) bus to use. |
err_t Adafruit_SI5351::setClockBuilderData | ( | void | ) |
Configures the Si5351 with config settings generated in ClockBuilder. You can use this function to make sure that your HW is properly configure and that there are no problems with the board itself.
Running this function should provide the following output: Channel 0: 120.00 MHz Channel 1: 12.00 MHz Channel 2: 13.56 MHz
err_t Adafruit_SI5351::setupPLL | ( | si5351PLL_t | pll, |
uint8_t | mult, | ||
uint32_t | num, | ||
uint32_t | denom | ||
) |
Sets the multiplier for the specified PLL.
pll | The PLL to configure, which must be one of the following:
|
mult | The PLL integer multiplier (must be between 15 and 90) |
num | The 20-bit numerator for fractional output (0..1,048,575). Set this to '0' for integer output. |
denom | The 20-bit denominator for fractional output (1..1,048,575). Set this to '1' or higher to avoid divider by zero errors. |
fVCO is the PLL output, and must be between 600..900MHz, where:
fVCO = fXTAL * (a+(b/c))
fXTAL = the crystal input frequency a = an integer between 15 and 90 b = the fractional numerator (0..1,048,575) c = the fractional denominator (1..1,048,575)
NOTE: Try to use integers whenever possible to avoid clock jitter (only use the a part, setting b to '0' and c to '1').
See: http://www.silabs.com/Support%20Documents/TechnicalDocs/AN619.pdf
err_t Adafruit_SI5351::setupPLLInt | ( | si5351PLL_t | pll, |
uint8_t | mult | ||
) |
Sets the multiplier for the specified PLL using integer values.
pll | The PLL to configure, which must be one of the following:
|
mult | The PLL integer multiplier (must be between 15 and 90) |
err_t Adafruit_SI5351::setupMultisynth | ( | uint8_t | output, |
si5351PLL_t | pllSource, | ||
uint32_t | div, | ||
uint32_t | num, | ||
uint32_t | denom | ||
) |
Configures the Multisynth divider, which determines the output clock frequency based on the specified PLL input.
output | The output channel to use (0..2) |
pllSource | The PLL input source to use, which must be one of:
|
div | The integer divider for the Multisynth output. If pure integer values are used, this value must be one of:
|
num | The 20-bit numerator for fractional output (0..1,048,575). Set this to '0' for integer output. |
denom | The 20-bit denominator for fractional output (1..1,048,575). Set this to '1' or higher to avoid divide by zero errors. |
The multisynth dividers are applied to the specified PLL output, and are used to reduce the PLL output to a valid range (500kHz to 160MHz). The relationship can be seen in this formula, where fVCO is the PLL output frequency and MSx is the multisynth divider:
fOUT = fVCO / MSx
Valid multisynth dividers are 4, 6, or 8 when using integers, or any fractional values between 8 + 1/1,048,575 and 900 + 0/1
The following formula is used for the fractional mode divider:
a + b / c
a = The integer value, which must be 4, 6 or 8 in integer mode (MSx_INT=1) or 8..900 in fractional mode (MSx_INT=0). b = The fractional numerator (0..1,048,575) c = The fractional denominator (1..1,048,575)
err_t Adafruit_SI5351::setupMultisynthInt | ( | uint8_t | output, |
si5351PLL_t | pllSource, | ||
si5351MultisynthDiv_t | div | ||
) |
Configures the Multisynth divider using integer output.
output | The output channel to use (0..2) |
pllSource | The PLL input source to use, which must be one of:
|
div | The integer divider for the Multisynth output, which must be one of the following values:
|
err_t Adafruit_SI5351::enableSpreadSpectrum | ( | bool | enabled | ) |
Enables or disables spread spectrum.
enabled | Whether spread spectrum output is enabled |
err_t Adafruit_SI5351::enableOutputs | ( | bool | enabled | ) |
Enables or disables all clock outputs.
enabled | Whether output is enabled |
err_t Adafruit_SI5351::setupRdiv | ( | uint8_t | output, |
si5351RDiv_t | div | ||
) |
output | Enables or disables output |
div | Set of output divider values (2^n, n=1..7) |