As stated in previous article ,I wrote python drivers for several popular signal generator modules.
Soon the Si5351 module I ordered arrived. It has unique characteristic. I put the driver for Si5351 in this repository.
Si5351 has 3 ~ 8 clock outputs with frequency ranging from 2.5KHz to 225MHz. Spread Spectrum mode is supported. Phase offset between clock outputs can be set. Si5351 functions as quadrature clock source if the phase offset is 90 degree.
It's difficult to develop a complete device driver for Si5351 because it has 108 registers. Fortunately, with USB-I2C converter we can test Si5351 directly with PC without uploading code to a MCU repeatedly, saving us lots of time and patience. Additionally, being able to set breakpoints and use the debug mode provided by PyCharm to trace code also speeds up the development.
Design and Features
- Besides what was stated in previous article, there are some special features for Si5351 :
- Alternative USB-I2C converter:
- We can use FT232H with Bridges package as USB-I2C converter.
- Also, FX2LP with this firmware can be used as USB-I2C converter,even faster.
- Using Cypress USB Control Center to fash custom_i2c.iic onto FX2LP.
- Python package used to communicate with FX2LP is here.
- Registers value comparision:
- We can compare two sets of register values, showing all register fields or just the mis-matched ones. This is very useful during device driver development.
- Find integer divider solution for PLL, in order to generate specific clock frequencies:
Test Results
Functional tests:
- Tested as in this notebook
Frequency Dancing (Sweeping)
- Tested with this notebook:
Control Si5351 with PC + FT232H (USB-I2C converter)
Control Si5351 with PC + FX2LP (USB-I2C converter)
- Also, we can upload the driver to an ESP32 and control Si5351 from there.
Control Si5351 with ESP32+MicroPython
- We can control an ESP32 with MicroPython Remote Kernel, via a Jupyter notebook
Control Si5351 with ESP32+MicroPython Remote Kernel
Dependencies:
沒有留言:
張貼留言