Si5351 VFO sketches

Back when Etherkit did come out with its Si5351 boards, I wrote some sketches to use these as VFO’s.  These sketches have been floating around the internet, without being collected at a single place, so thats going to change, in hope that it will reduce the repeating e-mails a bit.

Both sketches work as a basic VFO. It starts at a given frequency, and there is not implemented a method of changing bands. This can be easily added by someone with a little programming experience.  All of these sketches requires NT7S Si5351 library. Please support his development by buying a board.

The encoder used is a regular quadrature encoder (not Graycode, altough using a stepper motor as a graycode encoder should be investigated). There needs to be a couple debouncing capacitors (100nF) over each of the leads from encoder to ground. This should go as close to the encoder as possible. In addition, you may want to add a 22Ω resistor in series with the A and B leads, and another 100nF at the microcontroller side.

There is a RX/TX pin. Put this pin LOW for RX or the VFO will not tune. This is a tune inhibit function, and can be used for locking the tuning while TX.

The sketches are made to work on both AtMega328 and AtMega32U4 boards. There is some preprosessor switches to decide between those 2. If you use a different board, you may need to use a different set of interrupt pins, and some other preprosessor switches.

All of these sketches are provided free of charge, as is, for use by experimenters in non-comercial ways. There is no warranty nor support, altough I may answer some questions…

There exists 2 kinds of versions of the sketch depending on what display you want to use:

16×2 LCD  Display

This is the most common one.

51jy8enJluL

 

OLED display

There is some nice, small OLEDS around for $3 or so that can be used with a graphics library called U8glib: https://github.com/olikraus/u8glib

CBRj6jXWsAABwJQ

This version supports both Arduino Uno with ATMega 328, and Arduino Leonardo with ATMega 32U4.

If you do use this code, please send me a mention, either in the comment or on twitter so other can see what you are doing.

Advertisements

About Thomas S. Knutsen

Electronics engineer with interests in RF and analog electronics.
This entry was posted in Si5351, Uncategorized. Bookmark the permalink.

3 Responses to Si5351 VFO sketches

  1. Trystan's Workbench says:

    Excellent work.

    Just a quick note that using the latest si5351 library just one little change need to be done to the Arduino code for the VFO with the LCD. Just comment out the line:
    si5351.set_correction(corr);

    On the VFO one for the OLED, again comment out the above, and also replace the line:
    si5351.set_freq((frequency + iffreq) * 100ULL, 0, SI5351_CLK0);

    with:
    si5351.set_freq((frequency + iffreq) * 100ULL, SI5351_CLK0);
    (so we just take the 0, out of it)

    Your page really helped me – many thanks.
    Trystan

    • Indeed you are correct, the program was not updated to V2 of the Si5351 library.
      This is fixed now.

      • Trystan's Workbench says:

        Thomas,
        That’s great, the LCD sketch hasn’t been changed yet – I thought I would let you know in case you missed it. All the best, and thank you for all this.
        Trystan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s