VFO

The VFO program turns the RFzero into a GPS controlled VFO from 100 kHz to 268 MHz. The program has two VFOs A/B that can work in single frequency mode or split. RIT and XIT are also available from -9999 Hz to 9999 Hz. Tuning of VFOs, RIT and XIT takes place via rotary encoders. In CW mode the pitch offset is also set. Frequency stepping can be from 1 Hz to 10 MHz and in channel structures 5 kHz, 6,25 kHz, 12,5 kHz, 25 kHz or 50 kHz if required.

The RF output signal can be either 0°, 180°, I/Q in 90° or 270° or multiplied two, three or four times for external I/Q H/W. The band offset is taken into account, so the display frequency and output frequency don’t have to be the same.

The setup used during the development of the VFO.

LCDs, 16×2 and 20×4, and ILI9341 and ILI9488 are supported and especially relevant for the 16×2 LCDs four LEDs can be connected to show which VFO A/B and RIT/XIT the rotary encoders control.

On the keypad it is possible to change frequency, VFOs, frequency step, band and to recall or save the settings to memory.

In addition to the push buttons on the rotary encoders another 14 buttons can be connected for additional functionality.

All the features can also be controlled via the USB port.


Getting started

If you upload the VFO program without having a “proper” I2C bus H/W, i.e. with pull-up resistors to 3V3 on both the SDA (D8) and SCL (D9) pins, which may be stand-alone resistors or on an SX1509 module, the program will stop executing and the USB port will freeze. If so please see the I2C and SX1509 paragraph at the bottom of the page.

The first time you run the signal generator program you will have to enter the configuration mode and evoke the “wr defaults” command to setup the EEPROM in the correct way. Otherwise the parameters may be gibberish.


Display

To setup the type of display used please use the “wr display” command. If you want to change what is shown on the display please edit the display.cpp file.

Please see the display page for more information.

LCD 16×2

The display shows the two VFOs, RIT and XIT frequencies.

Example of an LCD 16×2.

If the XIT is inactive the last five characters of the keypad input are shown.

LCD 20×4

The display shows the two VFOs, RIT and XIT frequencies. The active VFO is indicated with a “>”. In CW mode the display show “CW”. The frequency steep value in Hz is also shown.

Example of an LCD 20×4.

When typing on the keypad the last five characters of the keypad input are shown.

ILI9341/ILI9488

The display shows the two VFOs, RIT and XIT frequencies. The active VFO is indicated with a “A” or “B” in reverse and in light blue color. In split mode the receiving VFO is in green and the transmitting VFO is in red. When the RIT is active it is printed in green background, and when the XIT is active it is printed on  red background. In CW mode the display show “CW”. The frequency steep value in Hz is also shown.

Example of an ILI9341 (true picture, distortion is due to Moiré from digital resizing).

When typing on the keypad the last ten characters of the keypad input are shown.


VFOs

The frequency range for all the output modes, except I/Q modulation, is 100 kHz to 268 MHz. The lower end of the frequency range for the I/Q modulation is 3,492 MHz.

The frequency can be changed using the keypad, MMI command or by turning the frequency rotary encoder.

The step value of the frequency rotary encoder can be changed by clicking its push button (1 MHz -> 100 kHz -> 10 kHz -> 1 kHz -> 100 Hz -> 10 Hz -> 1 MHz …, and/or the step values set by the steps mask bits to a maximum of 10 MHz -> 1 MHz -> 100 kHz -> 50 kHz -> 25 kHz -> 12,5 kHz -> 10 kHz -> 6,25 kHz -> 5 kHz -> 1 kHz -> 100 Hz -> 10 Hz -> 1 MHz ).

Set the frequency of the active VFO

  • Frequency rotary encoder
  • Keypad
    FREQ<Enter>
    where FREQ is the frequency in Hz
  • MMI
    wr freq FREQ
    where FREQ is the frequency in Hz

Set the frequency of a VFO A

  • Keypad
    FREQ<A><Enter> or
    where FREQ is the frequency in Hz
  • MMI
    wr freq FREQ a
    where FREQ is the frequency in Hz

Set the frequency of a VFO B

  • Keypad
    FREQ<B><Enter> or
    where FREQ is the frequency in Hz
  • MMI
    wr freq FREQ a
    where FREQ is the frequency in Hz

Select VFO A or VFOB

  • Push button
    A/B
    toggels between VFO A and VFO B is VFO B is on

Set VFO B on/off

  • Push button
    VFO B on/off
  • MMI
    wr vfob MODE
    where MODE: 0: off and 1: on

Set split mode

  • Push button
    Split
  • MMI
    wr vfob MODE
    where MODE is 2

RIT/XIT

Set RIT on/off

  • Push button
    RIT on/off
  • MMI
    wr ra ONOFF
    where ONOFF: 0: off and 1: on

Set RIT frequency

  • Rotary encoder
  • MMI
    wr rit FREQ
    where FREQ is 0

Set XIT on/off

  • Push button
    XIT on/off
  • MMI
    wr xa ONOFF
    where ONOFF: 0: off and 1: on

Set XIT frequency

  • Rotary encoder
  • MMI
    wr xit FREQ
    where FREQ is 0

Clear both RIT and XIT

  • Push button
    RIT and XIT clear
  • MMI
    wr rit FREQ
    wr xit FREQ
    where FREQ is 0

Changing band

Changing band can be done by changing the band from the memory.

  • Keypad
    NUMBER<Enter>
    where NUMBER is the band number
  • MMI
    wr band NUMBER
    where NUMBER is the band number

Saving and recalling memories

The settings can be recalled and saved to the memory, i.e. the EEPROM of the RFzero.

It is only possible to save, recall or view the settings when the program is in run mode.

Recall settings from memory

  • Keypad
    <#>NUMBER<#><Enter>
    where NUMBER is the memory number
  • MMI
    rd mem NUMBER
    where NUMBER is the memory number

Save the current settings to memory

  • Keypad
    <#>NUMBER<*><Enter>
    where NUMBER is the memory number
  • MMI
    wr mem NUMBER
    where NUMBER is the memory number

Keypad commands

CategoryCommandSyntaxNote
BandChange bandNUMBER<Enter>
FrequencyChange active VFO frequencyFREQ<Enter>
Change VFO A frequencyFREQ<A><Enter>
Change VFO B frequencyFREQ<B><Enter>If VFO B is enabled
Change the step frequency<*>FREQ<Enter>
MemoryRecall from memory<#>NUMBER<#><Enter>
Save current settings to memory<#>NUMBER<∗><Enter>

Configuration

The configuration of the program is done via the USB port, 9600 Baud, 8 bits, no parity and one stop bit, using a terminal program (e.g. Arduino IDE Serial Monitor, Termite Terminal (Windows), CuteCom (Linux) or Terminal (Mac OS) or the RFzero Manager (Windows)). Please connect the RFzero via a USB data cable to your computer and connect the terminal program to the right COM port in the terminal program. The RFzero identifies itself as an Arduino Zero (Windows Device Manager).

If you don’t see the RFzero> or RFzero config> prompts please press the enter key. When you want to execute a command you don’t have to enter the prompt but only the command and parameters after the >.

Changes to the configuration does not take effect before leaving the configuration mode.

All input to the RFzero must be in lowercase.

To enter the configuration mode please enter   config   at the RFzero> prompt, i.e.

RFzero> config

To see the available commands please enter   ?   at the RFzero config> prompt, i.e.

RFzero config> ?

To leave the configuration mode please enter   exit   at the RFzero config> prompt, i.e.

RFzero config> exit

When in configuration mode, i.e. when you see the RFzero config> prompt, the most frequent commands are

rd cfg

to see the configuration that will be used after exiting the configuration mode.

wr defaults

to set most of parameters to their default values. Please see the actual program for the specific default values.

wr t1 MODE

to set the T1 H/W mode where MODE is

  • 0: Transformer (default)
  • 1: Combiner
  • 2: None

wr display MODE

to set the display mode where MODE is

  • 0: None
  • 1: LCD 16 characters and two lines, HD44780 interface
  • 2: LCD 20 characters and four lines, HD44780 interface
  • 3: LCD 16 characters and two lines, HD44780 via I2C PCF8574 interface
  • 4: LCD 20 characters and four lines, HD44780 via I2C PCF8574 interface
  • 5: Graphics display, ILI9341 SPI interface
  • 6: Graphics display, ILI9488 SPI interface

wr pcf8574 ADDR

to set the I2C address of a PCF8574 series, if used, where ADDR is

  • 0: if not used
  • PCF8574 and PCK8574T: 0x20-0x27
  • PCF8574A: 0x38-0x3F

wr rotenc TYPE

to set the type of the rotary encoders used

  • 0: Full step
  • 1: Half step

If you have set the right rotary encoder type, then you will experience one step per click. If you on the other hand experience two steeps per click, then you have a full step rotary encoder, but are using a half step configuration. If you experience that you have to turn two clicks to get one step, then you are using a half step rotary encoder in a full step configuration.

Both the amplitude and the frequency rotary encoders have to be of the same type.

wr sx1509 ADDR

to set the SX1509 I2C address in hex to 3E, 3F, 70 or 71. Set to 0 if no SX1509 is connected. If set to 0 only the MMI commands, via the USB port, can be used to change the signal generator.

The most used address is 0x3E.

wr output MODE

to set the RF output MODE where

  • 0: 180°, the normal mode)
  • 1: 0°
  • 2: I/Q, 90°
  • 3: I/Q, 270°
  • 4: 2 x frequency, for external I/Q H/W
  • 5: 3 x frequency, for external I/Q H/W
  • 6: 4 x frequency, for external I/Q H/W

wr lo NUMBER FRLO FRHI FROFFSET

to set the band NUMBER low edge frequency FRLO, high edge frequency FRHI and offset frequency FROFFSET. The offset frequency can be either  positive or negative.

The sum of the low edge and offset frequencies must be above 100 kHz, and the sum of the high edge and offset frequencies must be below 268 MHz.

wr filter MODE

to set who the filters are controlled. If MODE is 0 then the filters follow the displayed frequency. If MODE is 1 then the filters follow the real frequency generated by the RFzero talking offset and output mode into account.

Set MODE to 0 if you want to control the “final” filters in your radio. Set MODE to 1 if you want to filter the output of the RFzero to the mixer.

wr filter INDEX CONTROL

to set the ULN2803A low pass filter CONTROL bit pattern, in hex, vs the highest frequency used for the INDEX where

  • 0: 125 kHz
  • 1: 250 kHz
  • 2: 500 kHz
  • 3: 1 MHz
  • 4: 2 MHz
  • 5: 3 MHz
  • 6: 5 MHz
  • 7: 8 MHz
  • 8: 13 MHz
  • 9: 21 MHz
  • 10: 35 MHz
  • 11: 58 MHz
  • 12: 90 MHz
  • 13: 160 MHz
  • 14: 268 MHz
  • 15: above 268 MHz

E.g. to set the control bits to 0x04 for the 13 MHz low pass filter

wr filter 8 4

If you are not familiar with binary and hex numbers please see the documentation here.

wr steps MASK

to set the MASK, in hex, controlling extra or only “odd” frequency increments when turning the rotary encoder. Bit 7 controls if the way the other seven bits are to be interpreted. If bit 7 is 0 then the increments are only coming from the other active bits in the MASK. If bit 7 is 1 then the normal increments, 10 Hz, 100 Hz, 1 kHz, 10 kHz, 100 kHz and 1 MHz,  will include the step values set by the other active bits in the MASK.

The MASK bits are

  • 7: Only/include the step(s), 0: only, 1: include
  • 6: 10 MHz
  • 5: 50 kHz
  • 4: 25 kHz
  • 3: 12,5 kHz
  • 2: 6,25 kHz
  • 1: 5 kHz
  • 0: 1 Hz

If you are not familiar with binary and hex numbers please see the documentation here.

wr pitch FREQ

to set the CW pitch frequency between 300 Hz and 1,5 kHz.


Hardware

You may use the VFO program without connecting anything else than a computer to the USB port. However, if you want to have a “true” VFO connecting a display (LCD or graphics), two rotary encoders with push buttons, a 4×4 keypad and up to 14 extra push buttons will be a great extension.

The VFO block schematic showing all the entities.

“Shopping list” and overview of the hardware entities and options.

EntityMinimumMediumMaximum
RFzeroXXX
DisplayXX
Frequency rotary encoderXX
RIT/XIT rotary encoderXX
SX1509 port expanderX
Keypad 4x4X
Frequency rotary encoder with push buttonX
RIT/XIT rotary encoder with push buttonX
6-14 extra push buttonX

The 4×4 keypad, rotary encoders with push buttons, push buttons, display, SX1509 are available from many sources.

Example of an SX1509 expander module.

Here is a connection schematic that shows how to wire all the entities together. Once the SX1509 and the rotary encoders have been connected you can load the VFO_SX1509test program to verify your work. This can be very helpful in case you need to troubleshoot instead of doing it via the signal generator program. Remember to connect each of the four LEDs through 1-5 kΩ resistors.

EntityPinConnected to entityConnected to pin
SX1509GNDRFzeroGND
3V3RFzero3V3
SDARFzeroD8 (SDA)
SCLRFzeroD9 (SCL)
INTRFzeroD17
IO0Keypad
Push buttons
5
Push button Y0
IO1Keypad
Push buttons
6
Push button Y1
IO2Keypad
Push buttons
7
Push button Y2
IO3Keypad
Push buttons
8
Push button Y3
IO4LED VFO ALED VFO A anode
IO5LED VFO BLED VFO B anode
IO6LED RITLED RIT anode
IO7LED XITLED XIT anode
IO8Keypad
Push buttons
1
Push button X0
IO9Keypad
Push buttons
2
Push button X1
IO10Keypad
Push buttons
3
Push button X2
IO11Keypad
Push buttons
4
Push button X3
IO12Push buttonsPush button X4
IO13Push buttonsPush button X5
IO14Push buttonsPush button X6
IO15Push buttonsPush button X7
Keypad (see also note below)1SX1509IO8
2SX1509IO9
3SX1509IO10
4SX1509IO11
5SX1509IO0
6SX1509IO1
7SX1509IO2
8SX1509IO3
RIT/XIT rotary encoderGNDRFzeroGND
ARFzeroA5
BRFzeroA4
Frequency rotary encoderGNDRFzeroGND
ARFzeroA2
BRFzeroA3

4×4 keypad (X0-X3/Y0-Y3) and the 4×4 push buttons (X4-X7/Y0-Y3) electrical layout, including the push buttons on the rotary encoders.

SX1509
row Y\column X
IO8
X0
IO9
X1
IO10
X2
IO11
X3
IO12
X4
IO13
X5
IO14
X6
IO15
X7
IO0/Y0123AVFO step (freq. RE)RIT/XIT toggle (RIT/XIT RE)freefree
IO1/Y1456BVFO B on/off RIT on/offfreefree
IO2/Y2789CVFO A/B toggleXIT on/offfreefree
IO3/Y3*0#EnterSplit on/offClear RIT and XITfreefree

Display

If you use a HD44780 compatible LCD connect it to the JP12 LCD connector in the normal way. Alternatively you may connect a graphics display. The type of display must be set in the configuration.

Connections for a graphical display controlled via SPI.

Edit
Display Signal RFzero
Not connected MISO D16
SDI/MOSI MOSI D18
SCK SCK D19

Rotary encoder (with push button)

The two rotary encoders with push buttons can be either full- or half-step. It is not important which one you have. In the configuration you can setup which type is used.

None of the push button pins, X and Y, must have connection to the rotary encoder ground pin.

Keypad

Adding a 4×4 standard keypad to your RFzero will make it easy to change frequency. To make it even easier to remember which keys to use the <D> key can be modified using a scalpel so the <D> key will look like an <Enter> key arrow. The <C> key functions a backspace/clear key.

Example of a keypad where the <D> key has been modified to look like an <Enter> arrow by removing the red parts of the letter and a membrane type.


Please note that some keypads may have unused terminals.


I2C and SX1509

The SX1509, and if you use an LCD with I2C access, are connected to the RFzero via the I2C/Wire bus. Please remember to connect the pull-up resistors yourself if you use the bare IC. Most ready made modules already have the pull-up resistors mounted.

If no pull-up resistors are connected the I2C bus will hang, and it will cause the program and USB port to hang too. This is not unique to the RFzero, but is a general thing in Arduino.

If the program hangs please connect two resistor, 2 kΩ to 10 kΩ, from 3V3 to each of the D8 (SDA) and D9 (SCL) pins. Then press the reset button. If this fails try to upload the program again, while being prepared to double click the reset button, until the uploading is successful. You may then, in the configuration, set both the SX1509 and the MCP23017 addresses to 0 which disables the activation and use of the I2C bus.

Alternatively upload the disable I2C user bus program to disable the signal generator from using the I2C user bus until you have the pull-up resistors in place. If successful you may then load the signal generator program again.

You can see more tricks in the troubleshooting guide.