Arduino Frequency Synthesiser Using 160MHz Si5351

10,568

8

11

About: 55+ years in electronics, computers, and teaching ... now retired.

Intro: Arduino Frequency Synthesiser Using 160MHz Si5351

This Instructable describes the construction, and operation, of a stand-alone frequency synthesiser suitable for use as a signal generator, or for use as the local oscillator in an amateur band transmitter or receiver.

My prototype was built on a piece of "Vero" board. The ATmega328P must be socketed if you choose to make your own "Vero" board Arduino. The Arduino source code is well annotated and contains links to all of the required "libraries". Construction is not critical.

Adafruit Si5351A Clock Generator:

The heart of this frequency synthesiser is the "Adafruit Si5351A Clock Generator Breakout Board" which can generate up to three outputs in the frequency range of 8KHz to 160MHz. The Si5351 breakout board is designed to run off 5 volts and has an I2C interface which makes it easy to connect to an Arduino. All that you need is an Arduino, a rotary encoder, a 16 character x 2 line I2C LCD display, and some software. The output level from this synthesiser is approximately 3 volts peak-to-peak.

Rotary Encoder:

The second most important component is the rotary encoder which outputs the following two-bit "Gray" code pattern:

.

11 (indent - CCW)

10

00

01

11 (indent - reference )

10

00

01

11 (indent - CW)

.

The encoder always rests at an indent (pattern 11) when the tuning knob is stationary. If the tuning knob is turned CCW (counter clock-wise) then the pattern sequence between indents is 01, 00, 10, 11. If, however, the tuning knob is turned CW (clock-wise) then the pattern sequence between indents is 10, 00, 01, 11. This pattern reversal allows us to determine the tuning direction. The new frequency is determined by multiplying the number of "indents" by the tuning step-size and adding/subtracting this offset to/from the current frequency.

The rotary encoder comes fitted with a single-pole push switch which I use to control the tuning step-size in increments of 10, 100, 1000, 10000, and 100000 Hz. A brief push on the tuning knob increases the tuning step-size. A longer push on the tuning knob causes the step-size to decrease.

All mechanical switches suffer from contact bounce which makes for erratic tuning. Instead of "debouncing" each switch with hardware I am using a software integrator.

A SPST band-change switch has been included. When the switch is activated it is possible to cycle through each of the amateur radio bands by rotating the tuning knob. The tuning knob behaves normally when the switch is deactivated.

Programming:

Programming the ATmega328P microcontroller is relatively simple. First install the "libraries" documented in "source_code.txt". Paste the contents of "source_code.txt" into a new arduino sketch and save it as "signal_generator.ino". Click "file/upload" and, all going well, "signal _generator.ino" will compile then upload to your Arduino R3 UNO. Once the file has been uploaded, unplug the ATmega328P microcontroller from your Arduino R3 UNO and insert it into your "Vero" board socket. Apply 9 volts and everything should light up.

Important:

Even though the breakout board runs off 5 volts, the Si5351 chip itself runs off 3.3 volts. This means that the maximum voltage from each output is 3.3 volts. A buffer is therefore required when interfacing to 5 volt logic circuits.

  Click here   to view my other instructables.

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Furniture Contest 2018

      Furniture Contest 2018

    11 Discussions

    0
    None
    Custech

    Question 2 months ago

    Hello, thank you for sharing your project and congratulations! I would like to ask you which version of the si5351 library did you use? I'm having problems compiling with many errors. The functions of the library and the code have different numbers of arguments. For example si5351.init () in your code has a single argument but in the library you indicated all the versions have two or three arguments. Does not work. Can you help me?

    6 more answers
    0
    None
    lingibCustech

    Answer 2 months ago

    Thank you for your interest in my project :)

    There are many I2C libraries for 16 character x 2 line LCD displays. Depending on your LCD some libraries may not work.

    You comment "For example si5351.init () in your code has a single argument but in the library you indicated all the versions have two or three arguments." indicates that you are using a more recent library from https://github.com/etherkit/Si5351Arduino.

    I have just looked at this site and it appears that the code has changed as under the heading "Changes from v1 to v2" it reads: "The init() method now has three parameters: the crystal load capacitance, the reference frequency, and the frequency correction value (with this last parameter being a new addition). You'll need to add that third parameter to your old init() calls, but then you can delete any set_correction() calls after that (unless you explicitly are changing the frequency correction after the initialization)."

    This explains why my code (it's now two years old) only has a single parameter. It would appear that extra parameters must be added to some of my code lines if you wish to use the latest github code.

    Also your comment "For example si5351.init() in your code has a single argument but in the library you indicated all the versions have two or three arguments." has me puzzled as there is no "si5351.init()" in my code. In line 40 I instantiate the word "clockgen" then use "clockgen.init()" in line 57?

    The site http://arduino-info.wikispaces.com/LCD-Blue-I2C#v1 (see my code line 23) contains much helpful information ... but visit this site before July 31 as a pop-up message indicates that this site will no longer be available after this date.

    My 16x2 line LCD is marked "YwRobot Arduino LCM1602 IIC V1" and the library I used from this site has a link "LCD Version 1 - Marked "YwRobot Arduino LCM1602 IIC V1" ALSO version marked "A0 A1 A2" on lower right (and also labelled "MH")".

    When you click this link you are taken to a sample sketch in which there is a reference to https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/ which also contains a number of I2C libraries. Perhaps you could try one of these?

    See also my comments to AdrianF2 below who asked "What library do you used?"

    0
    None
    Custechlingib

    Reply 2 months ago

    Hello, thank you for kindly responding. The part of the display did not give any error message so I do not think it will be a problem. But thanks for the tips. In the source code you mention the web address and the version of the display library that you used then became easy. I used the file Newliquidcrystal_1.3.5.zip at the indicated web address. The file name itself already tells you which version it is. The Si5351 library is what looks like a headache. I followed your guidelines for AdrianF2 but my problems are after that. It would be very simple if there was still the version of the library you used available for download. I will work with this new version following your guidelines. I apologize for my error Si5351.init (). I wanted to refer to the class method in the library that was changed and not to the clockgen object in your source code. I meant Si5351 :: init (). I will work here and when I finish I will post here the libraries and modifications that I made to work. Once again thank you very much for your kindness in helping.

    0
    None
    lingibCustech

    Reply 2 months ago

    Hi,

    A zipped version of the (original) LiquidCrystal_I2C library is attached.

    Thanks for drawing my attention to the fact that the original libraries have been updated.

    Look forward to seeing your code updates.

    0
    None
    Custechlingib

    Reply 2 months ago

    Hi, thanks for attaching the display library. It will certainly be of help. But my problem as I mentioned is in the Si5351 library. I do not want to abuse your generosity. But could not you also send the library you used from Si5351? I'm sure it would make it a lot easier for me and other readers who want to build this project without having to go into the new Si5351 library. Many thanks again for your always generous help.

    0
    None
    lingibCustech

    Reply 2 months ago

    Hi,

    This is the only other library that I can find. The files are dated 1/05/2017 ... hopefully this is what you are looking for.

    0
    None
    Custechlingib

    Reply 2 months ago

    Thanks a lot for the help. It will be useful to me and other readers I'm sure. Thank you so much!

    0
    None
    lingibAdrianF2

    Reply 2 years ago

    The "si5351" library may be found at https://github.com/etherkit/Si5351Arduino

    The "si5351.h" and "si5351.cpp" files are contained in a folder named "src" which must be renamed to "si5351" (without the quotes).

    The correct liquid crystal library depends on your LCD. I used one from http://arduino-info.wikispaces.com/LCD-Blue-I2C#v1