Datasheet

adafruit_si5351.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has
the adafruit_si5351.mpy, and adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt.
Python Installation of SI5351 Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also
require enabling I2C on your platform and verifying you are running Python 3. Since each platform is a little different,
and Linux changes often, please visit the CircuitPython on Linux guide to get your computer
ready (https://adafru.it/BSN)!
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-si5351
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use
CircuitPython on Python 2.x, it isn't supported!
CircuitPython & Python Usage
To demonstrate the usage of the sensor we'll initialize it and control the clocks from the board's Python REPL. Run the
following code to import the necessary modules and initialize the I2C connection with the sensor:
Now you're ready to configure the PLLs and clock outputs on the chip. The SI5351 is somewhat complex and allows
quite many configurations to balance the accuracy and range of clock output values. You'll want to review the
datasheet (https://adafru.it/C5E) to understand the capabilities and features of the chip.
Configure Phase Lock Loops
First you'll need to configure one of the two PLLs (phase-locked loops, special hardware that can 'multiply' the 25 MHz
crystal to much faster speeds) which will be used as the source of any of the clock outputs. The Si5351 object has two
PLL objects you can manipulate:
pll_a This is the PLL A hardware on the chip.
pll_b This is the PLL B hardware on the chip.
You can configure each PLL's multiplier by calling the configure_integer or configure_fractional function. The integer
configuration lets you set an integer multiplier for the 25 MHz base crystal frequency. This is the most accurate way to
control frequency but you can only set integer multiples. For example to set PLL A to 500 MHz you'd set an integer
multiplier of 20 (25 MHz * 20 = 500 MHz):
import board
import busio
import adafruit_si5351
i2c = busio.I2C(board.SCL, board.SDA)
si5351 = adafruit_si5351.SI5351(i2c)
si5351.pll_a.configure_integer(20)
© Adafruit Industries https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout Page 20 of 26