Adafruit Si5351 Library
Public Member Functions | List of all members
Adafruit_SI5351 Class Reference

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)
 

Detailed Description

SI5351 class.

Constructor & Destructor Documentation

◆ Adafruit_SI5351()

Adafruit_SI5351::Adafruit_SI5351 ( void  )

SI5351 object.

Constructor

Member Function Documentation

◆ begin()

err_t Adafruit_SI5351::begin ( TwoWire *  theWire = &Wire)

Initializes I2C and configures the breakout (call this function before doing anything else)

Returns
ERROR_NONE
Parameters
theWireThe I2C (Wire) bus to use.

◆ setClockBuilderData()

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.

Returns
ERROR_NONE

Running this function should provide the following output: Channel 0: 120.00 MHz Channel 1: 12.00 MHz Channel 2: 13.56 MHz

Note
This will overwrite all of the config registers!

◆ setupPLL()

err_t Adafruit_SI5351::setupPLL ( si5351PLL_t  pll,
uint8_t  mult,
uint32_t  num,
uint32_t  denom 
)

Sets the multiplier for the specified PLL.

Returns
ERROR_NONE
Parameters
pllThe PLL to configure, which must be one of the following:
  • SI5351_PLL_A
  • SI5351_PLL_B
multThe PLL integer multiplier (must be between 15 and 90)
numThe 20-bit numerator for fractional output (0..1,048,575). Set this to '0' for integer output.
denomThe 20-bit denominator for fractional output (1..1,048,575). Set this to '1' or higher to avoid divider by zero errors.

Configuration

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

◆ setupPLLInt()

err_t Adafruit_SI5351::setupPLLInt ( si5351PLL_t  pll,
uint8_t  mult 
)

Sets the multiplier for the specified PLL using integer values.

Returns
ERROR_NONE
Parameters
pllThe PLL to configure, which must be one of the following:
  • SI5351_PLL_A
  • SI5351_PLL_B
multThe PLL integer multiplier (must be between 15 and 90)

◆ setupMultisynth()

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.

Returns
ERROR_NONE
Parameters
outputThe output channel to use (0..2)
pllSourceThe PLL input source to use, which must be one of:
  • SI5351_PLL_A
  • SI5351_PLL_B
divThe integer divider for the Multisynth output. If pure integer values are used, this value must be one of:
  • SI5351_MULTISYNTH_DIV_4
  • SI5351_MULTISYNTH_DIV_6
  • SI5351_MULTISYNTH_DIV_8 If fractional output is used, this value must be between 8 and 900.
numThe 20-bit numerator for fractional output (0..1,048,575). Set this to '0' for integer output.
denomThe 20-bit denominator for fractional output (1..1,048,575). Set this to '1' or higher to avoid divide by zero errors.

Clock Configuration

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)

Note
Try to use integers whenever possible to avoid clock jitter
For output frequencies > 150MHz, you must set the divider to 4 and adjust to PLL to generate the frequency (for example a PLL of 640 to generate a 160MHz output clock). This is not yet supported in the driver, which limits frequencies to 500kHz .. 150MHz.
For frequencies below 500kHz (down to 8kHz) Rx_DIV must be used, but this isn't currently implemented in the driver.

◆ setupMultisynthInt()

err_t Adafruit_SI5351::setupMultisynthInt ( uint8_t  output,
si5351PLL_t  pllSource,
si5351MultisynthDiv_t  div 
)

Configures the Multisynth divider using integer output.

Returns
ERROR_NONE
Parameters
outputThe output channel to use (0..2)
pllSourceThe PLL input source to use, which must be one of:
  • SI5351_PLL_A
  • SI5351_PLL_B
divThe integer divider for the Multisynth output, which must be one of the following values:
  • SI5351_MULTISYNTH_DIV_4
  • SI5351_MULTISYNTH_DIV_6
  • SI5351_MULTISYNTH_DIV_8

◆ enableSpreadSpectrum()

err_t Adafruit_SI5351::enableSpreadSpectrum ( bool  enabled)

Enables or disables spread spectrum.

Parameters
enabledWhether spread spectrum output is enabled
Returns
ERROR_NONE

◆ enableOutputs()

err_t Adafruit_SI5351::enableOutputs ( bool  enabled)

Enables or disables all clock outputs.

Parameters
enabledWhether output is enabled
Returns
ERROR_NONE

◆ setupRdiv()

err_t Adafruit_SI5351::setupRdiv ( uint8_t  output,
si5351RDiv_t  div 
)
Parameters
outputEnables or disables output
divSet of output divider values (2^n, n=1..7)
Returns
ERROR_NONE

The documentation for this class was generated from the following files: