Table of contents
The signal generator program turns the RFzero into a semi-professional GPSDO controlled signal source from 2289 Hz to 290 MHz and beyond. In addition to a single frequency source the RFzero can also generate two-tone, I/Q, H3A or spread spectrum signals or be used as a sweep generator. It is also possible to control various attenuators making the output level variable.
The setup used during the development of the signal generator.
The amplitude and frequency can be controlled via a keypad, rotary encoders or via the USB port. Different kinds of displays can also be used.
If you want to work very closely with the Si5351A you can try the SigTest program that allows direct register manipulation among other things.
Getting started
If you upload the signal generator 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, SX1509 and MCP23017 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.
Users
W2UA
Jeff, W2UA, has made a really nice 3D enclosure for his signal generator.
The RFzero in a 3D enclosure. Picture courtesy Jeff, W2UA.
OZ2XH
Hans, OZ2XH, has put his RFzero signal generator in a very small enclosure with an ILI9341 display.
The RFzero signal generator with an ILI9341 2,8″ display and keypad. Picture courtesy Hans, OZ2XH.
ZP4KFX
Pino, ZP4KFX, has build his signal generator into a project box and included an PE4302 attenuator too.
The RFzero signal generator during build. Picture courtesy Pino, ZP4KFX.
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 frequency/~ies, the “.” shows which frequency is currently controlled by the frequency rotary encoder, the signal level for frequency0, the last three characters of the keypad input and the output mode.
Example of an LCD 16×2.
LCD 20×4
The display shows the frequency/~ies, the “>” shows which frequency is currently controlled by the frequency rotary encoder, the signal level(s), the output mode and its possible parameters (sweep: points and dwell time [ms], spread spectrum: modulation amplitude). The last line is used for keypad input.
Example of an LCD 20×4.
Miscellaneous commands
config
to enter the configuration mode where static changes to the configuration can be made. Please see configuration commands for more details.
rd set
to read the current settings in run mode. This are not the same as found in the configuration mode.
?
to list the help text.
Frequency
The frequency range for all the output modes, except I/Q modulation, is 2289 Hz to 200 MHz and beyond. The closer the frequency gets to 300 MHz the less likely it is that the Si5351A PLL locks. This means that the frequency is highly unstable or not even generated. 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 Hz -> 1 MHz …) in single frequency modes. In dual frequency modes clicking the frequency rotary encoder will toggle between f0 and f1. The step value of the frequency rotary encoder can also be changed by using the keypad, menu or MMI.
Single frequency modes: push-pull, I/Q and spread spectrum.
Dual frequency modes: two-tone, H3A and sweep.
Set the frequency in single frequency modes
- Frequency rotary encoder
- Keypad
<F>FREQ<Enter>
where FREQ is the frequency in Hz
Pressing <*> after the second position pads the input with “000” - Menu
Not possible - MMI
wr freq FREQ
where FREQ is the frequency in Hz
Set the frequencies in dual frequency modes
- Frequency rotary encoder
where the “>”/ “.” indicates the active frequency - Keypad
<F>FREQ <*><0><Enter>
<F>FREQ <*><1><Enter>
where FREQ is the frequency in Hz, <0> is for frequency0 and <1> is for frequency1
Pressing <*> after the second position pads the input with “000” - Menu
Not possible - MMI
wr freq FREQ PORT
where
– FREQ is the frequency in Hz
– PORT is the port 0/1 or start/stop for the sweep mode
Set the frequency step value
- Frequency rotary encoder push button
Click
only in single frequency output modes otherwise it toggles between f0 and f1 - Keypad
<F><*>FREQ <Enter>
where FREQ is the frequency step in Hz - Menu
Not yet defined - MMI
wr fstep STEP
where STEP the step frequency from 1 Hz to 10 MHz
In single frequency mode the frequency step value is shown as a caret “^” under the digit, if the step value is 1 Hz, 10 Hz, … 1 MHz otherwise the value is shown.
Please note that if the settings are saved to the memory, the step frequency will be rounded up to nearest power of 10 integer, unless the step is 5 kHz, 6,25 kHz, 12,5 kHz or 25 kHz.
Amplitude
It is possible to change the amplitude of the output from the RFzero if you have connected an external attenuator. The attenuator defines the insertion loss and minimum output level.
In two-tone, H3A and sweep modes the amplitude is calculated using the f0.
The amplitude can be changed using the keypad, MMI command or by turning the amplitude rotary encoder. The step value of the amplitude rotary encoder can be changed by clicking the its push button (toggles between 1 dB or the decimal resolution of the attenuator), using the keypad, menu or MMI.
Switch the RF on/off
- RF on/off button
- Keypad
Not possible - Menu
Not available - MMI
wr rf ONOFF
where ONOFF os 0 for off and 1 for on
Set the amplitude
- Amplitude rotary encoder
- Keypad
<A>LEVEL<Enter>
where LEVEL is the amplitude in dBm - Menu
Not available - MMI
wr amp LEVEL
Set the amplitude step value
- Amplitude rotary encoder push button
Click toggles between 1 dB and decimal step - Keypad
Not possible - Menu
Att. step | Att 1 dB or
Att. step | Att decimal - MMI
wr astep STEP
where STEP is “one” for 1 dB step and “dec” for decimal step
Set the attenuation level
- Keypad
Not possible - Menu
Not available - MMI
wr att LEVEL
where LEVEL is in dB
Output modes
The RFzero can be set to different output modes
- Push-pull (default)
- Two-tone
- I/Q modulation
- H3A modulation
- Sweep
- Spread spectrum
The frequency range for all modes, except I/Q modulation, is 2289 Hz to 200 MHz and beyond. The closer the frequency is to 300 MHz, the more likely it is, that the Si5351A gets out of lock, and the frequency is not made or highly unstable. The lower end of the frequency range for the I/Q modulation is 3,492 MHz.
Each output mode has a keypad, menu and MMI command that sets the mode.
Push-pull
This mode has the highest power and the best spurious and harmonic performance. Especially the even harmonics are very low. This is also the standard mode for most lab work.
Example of a push-pull signal.
Set the output mode
- Keypad
<*><0><Enter> - Menu
Output mode | Push-pull - MMI
wr output 0
Two-tone
The two-tone mode is very useful for testing the linearity of amplifiers. To release the full potential T1 has to be changed from the factory mounted transformer to a combiner.
Example of the a two-tone signal with the third order IMD products at -66 dB PEP.
In general it applies that if the IMD of the input signal to an amplifier is -12 dB then the contribution to the output is 6%.
Set the output mode
- Keypad
<*><1><Enter> - Menu
Output mode | Two-tone - MMI
wr output 1
I/Q modulation
I/Q modulation consist of two signals, with the same frequency, that are 90° out of phase.
Example of I/Q modulation signals (I: yellow) and Q: purple).
To release the full potential T1 has to be removed. The I and Q signals can then be found on CON4 and CON5.
Set the output mode
- Keypad
<*><2><Enter> - Menu
Output mode | I/Q - MMI
wr output 2
H3A modulation
This is a variant of amplitude modulation (AM), where only one of the side bands is generated. In the receiver it will sound like normal AM.
Example of a H3A modulation signal with a 1 kHz modulation tone.
The amplitude of the side band (f1) is about 10 dB lower than the carrier (f0).
Set the output mode
- Keypad
<*><3><Enter> - Menu
Output mode | H3A - MMI
wr output 3
Sweep
Sweeps between the start and stop frequencies using either 51, 101, 301 or 501 points and with a dwell time between 2 ms and 1024 ms.
Example of a sweep spectrum signal using max hold. Some glitches can be expected.
When the sweep starts a pulse, low to high, with a duration similar to the dwell time is made on A1.
When the sweep is running a DC voltage ramp, 0 V to 3,3 V, is present on A0.
Example of the sweep trigger (purple) and DC voltage ramp (yellow).
To enable the sweep mode please perform the below steps
- Set the sweep output mode
- Set the start frequency (f0) or use what is already set
- Set the stop frequency (f1) or use what is already set
- Set the number of sweep points and dwell time
It is not necessary to set the sweep output mode again if changing the sweep parameters, i.e. sweep points and dwell time, start and stop frequencies.
Set the output mode
- Keypad
<*><4><Enter> - Menu
Output mode | Sweep - MMI
wr output 4
Toggle the sweep on/off
- Keypad
<*><4><*><Enter> - Menu
Not available - MMI start/stop frequencies respectively
wr sweep 1
wr sweep 0
Set the number of sweep points, dwell time and start the sweep
- Keypad
<*><4><*>POINTS<*>TIME<Enter>
where
– POINTS is the number of sweep points 51, 101, 301 and 501
– TIME is the dwell time from 2 ms to 1024 ms - Menu
Sweep pts. | Swp POINTS pts
where POINTS are 51, 101, 301 or 501 - MMI
wr sweep POINTS DWELL
where
– POINTS is the number of sweep points 51, 101, 301 and 501
– DWELL is the dwell time from 2 ms to 1024 ms
Set the start and stop frequencies
- Keypad
<F>FREQ<*><0><Enter>
<F>FREQ<*><1><Enter>
where FREQ is the frequency in Hz, <0> is for the start frequency and <1> is for the stop frequency
Pressing <*> after the second position pads the input with “000” - Menu
Not available - MMI start/stop frequencies respectively
wr freq FREQ 0
wr freq FREQ 1
where FREQ0 is the start frequency in Hz and FREQ1 is for the stop frequency in Hz
Spread spectrum
The RFzero can be set to generate a spread spectrum signal with a modulation amplitude from 0,1% to 1,5% of the signal frequency.
To enable spread spectrum is a three step process
- Set the spread spectrum output mode
- Set the frequency or use the one already set
- Set the modulation amplitude
To disable the spread spectrum output mode set a different output mode.
Example of a spread spectrum signal.
Set the spread spectrum output mode
- Keypad
<*><5><Enter> - Menu
Output mode | Spread spec - MMI
wr output 5
Set the spread spectrum modulation amplitude percentage
- Keypad
<*><5><*>PCT<Enter>
where PCT is modulation amplitude percentage in 0,1% increments from 0,1% to 1,5%, but multiplied by 10, e.g. 10 for 1%
The current frequency is used or set a new one - Menu
Spread spec | SS amp #.#% - MMI
wr spread PCT
where PCT is modulation amplitude percentage in 0,1% increments from 0,1% to 1,5%
The current frequency is used or set a new one
Saving, recalling and viewing settings
The settings can be recalled and saved to the memory, i.e. the EEPROM of the RFzero.
When the RFzero signal generator program starts the settings from memory 0 are loaded. But the RF is always off.
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 - Menu
Recall mem. | Recall NUMBER
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 - Menu
Save memory | Save NUMBER
where NUMBER is the memory number - MMI
wr mem NUMBER
where NUMBER is the memory number
Please note that the step frequency will be rounded up to nearest power of 10 integer, unless the step is 5 kHz, 6,25 kHz, 12,5 kHz or 25 kHz, and the sweep dwell time will be rounded up to nearest power of 2 integer.
Save settings to memory
- Keypad
Not possible - Menu
Not possible - MMI
wr mem NUMBER MODE FREQ0 FREQ1 FSTEP ATT ASTEP SWPTS SWTIME SSAMPL
where
– NUMBER is the memory number
– MODE is the output mode number
– FREQ0 is the f0
– FREQ1 is the f1
– FSTEP is the frequency step value in Hz
– ATT is the attenuation level
– ASTEP is the attenuation step “one” or “dec”
– SWPTS is the number of sweep points
– SWTIME s the sweep dwell time
– SSAMPL is the spread spectrum amplitude
All values have to be included even if they are not used for the actual output mode. Thus valid but dummy values can be used.
Please note that the step frequency will be rounded up to nearest power of 10 integer, unless the step is 5 kHz, 6,25 kHz, 12,5 kHz or 25 kHz, and the sweep dwell time will be rounded up to nearest power of 2 integer.
Viewing the settings
- Keypad
Not possible - Menu
Not possible - MMI
rd set
The settings are listed on the USB port.
Keypad command overview
Category | Command | Syntax | Note |
---|---|---|---|
Amplitude | Set the amplitude level in dBm | <A>LEVEL<Enter> | |
Negative sign | <#> | ||
Decimal separator | <∗> | ||
Frequency | Single frequency modes | <F>FREQ<Enter> | |
Sweep start frequency | <F>FREQ<#>0<Enter> | ||
Sweep stop frequency | <F>FREQ<#>1<Enter> | ||
Dual frequency modes | <F>FREQ<#>PORT<Enter> | ||
Pad input with 000 | <∗> | ||
Step value | <F><∗>FREQ<Enter> | ||
Output mode | Set push-pull | <∗><0><Enter> | |
Set two-tone | <∗><1><Enter> | ||
Set I/Q | <∗><2><Enter> | ||
Set H3A | <∗><3><Enter> | ||
Set sweep | <∗><4><Enter> | ||
Set sweep points and dwell time | <∗><4><∗>POINTS<∗>TIME<Enter> | Also starts the sweep | |
Start/stop sweeping | <∗><4><∗><Enter> | ||
Set spread spectrum | <∗><5><Enter> | ||
Set modulation amplitude percentage | <∗><5><∗>PCT<∗><Enter> | PCT is x10%, e.g. 10 for 1% | |
Memory | Recall from memory | <#>NUMBER<#><Enter> | |
Save current settings to memory | <#>NUMBER<∗><Enter> |
Here is a keypad command overview to print and keep next to your signal generator.
Menu overview
To enable/disable the menu click the menu button. When the menu is enabled it is shown in the keypad area. The menu is not available if the display only has 16 characters and two lines.
The menu loops around and the sweep and spread spectrum menu items are only visible if the output mode has been set to sweep or spread spectrum respectively.
Category | Menu | Note | Equivalent MMI command |
---|---|---|---|
Output mode | Push-pull | Set push-pull mode | wr output 0 |
Two-tone | Set two-tone mode | wr output 1 | |
I/Q | Set I/Q mode | wr output 2 | |
H3A | Set H3A mode | wr output 3 | |
Sweep | Set sweep mode. Remember to set points and dwell time | wr output 4 | |
Spread spec | Set spectrum mode. Remember to set sweep amplitude | wr output 5 | |
Sweep points | Swp 51 pts | Sweep with 51 points and 100 ms dwell time | wr sweep 51 100 |
Swp 101 pts | Sweep with 101 points and 100 ms dwell time | wr sweep 101 100 | |
Swp 301 pts | Sweep with 301 points and 100 ms dwell time | wr sweep 301 100 | |
Swp 501 pts | Sweep with 501 points and 100 ms dwell time | wr sweep 501 100 | |
Spread spectrum | SS amp 0.1% | Set spread spectrum amplitude percentage to 0.1% | wr spread 0.1 |
SS amp 0.2% | Set spread spectrum amplitude percentage to 0.2% | wr spread 0.2 | |
SS amp 0.3% | Set spread spectrum amplitude percentage to 0.3% | wr spread 0.3 | |
SS amp 0.4% | Set spread spectrum amplitude percentage to 0.4% | wr spread 0.4 | |
SS amp 0.5% | Set spread spectrum amplitude percentage to 0.5% | wr spread 0.5 | |
SS amp 0.6% | Set spread spectrum amplitude percentage to 0.6% | wr spread 0.6 | |
SS amp 0.7% | Set spread spectrum amplitude percentage to 0.7% | wr spread 0.7 | |
SS amp 0.8% | Set spread spectrum amplitude percentage to 0.8% | wr spread 0.8 | |
SS amp 0.9% | Set spread spectrum amplitude percentage to 0.9% | wr spread 0.9 | |
SS amp 1.0% | Set spread spectrum amplitude percentage to 1.0% | wr spread 1.0 | |
SS amp 1.1% | Set spread spectrum amplitude percentage to 1.1% | wr spread 1.1 | |
SS amp 1.2% | Set spread spectrum amplitude percentage to 1.2% | wr spread 1.2 | |
SS amp 1.3% | Set spread spectrum amplitude percentage to 1.3% | wr spread 1.3 | |
SS amp 1.4% | Set spread spectrum amplitude percentage to 1.4% | wr spread 1.4 | |
SS amp 1.5% | Set spread spectrum amplitude percentage to 1.5% | wr spread 1.5 | |
Frequency step | 1 Hz | Set the frequency step to 1 Hz | wr fstep 1 |
10 Hz | Set the frequency step to 10 Hz | wr fstep 10 | |
100 Hz | Set the frequency step to 100 Hz | wr fstep 100 | |
1 kHz | Set the frequency step to 1 kHz | wr fstep 1000 | |
5 kHz | Set the frequency step to 5 kHz | wr fstep 5000 | |
6.25 kHz | Set the frequency step to 6,25 kHz | wr fstep 6250 | |
10 kHz | Set the frequency step to 10 kHz | wr fstep 10000 | |
12.5 kHz | Set the frequency step to 12,5 kHz | wr fstep 12500 | |
25 kHz | Set the frequency step to 25 kHz | wr fstep 25000 | |
100 kHz | Set the frequency step to 100 kHz | wr fstep 100000 | |
1 MHz | Set the frequency step to 1 MHz | wr fstep 1000000 | |
Attenuator step | Att 1 dB | Set the attenuator step to 1 dB | wr astep one |
Att decimal | Set the attenuator step to the least possible decimal value | wr astep dec | |
Recall memory | Recall 0 | Recall memory 0 settings | rd mem 0 |
Recall 1 | Recall memory 1 settings | rd mem 1 | |
Recall 2 | Recall memory 2 settings | rd mem 2 | |
Recall 3 | Recall memory 3 settings | rd mem 3 | |
Recall 4 | Recall memory 4 settings | rd mem 4 | |
Recall 5 | Recall memory 5 settings | rd mem 5 | |
Recall 6 | Recall memory 6 settings | rd mem 6 | |
Recall 7 | Recall memory 7 settings | rd mem 7 | |
Recall 8 | Recall memory 8 settings | rd mem 8 | |
Recall 9 | Recall memory 9 settings | rd mem 9 | |
Save memory | Save mem 0 | Save settings to memory 0 | wr mem 0 |
Save mem 1 | Save settings to memory 1 | wr mem 1 | |
Save mem 2 | Save settings to memory 2 | wr mem 2 | |
Save mem 3 | Save settings to memory 3 | wr mem 3 | |
Save mem 4 | Save settings to memory 4 | wr mem 4 | |
Save mem 5 | Save settings to memory 5 | wr mem 5 | |
Save mem 6 | Save settings to memory 6 | wr mem 6 | |
Save mem 7 | Save settings to memory 7 | wr mem 7 | |
Save mem 8 | Save settings to memory 8 | wr mem 8 | |
Save mem 9 | Save settings to memory 9 | wr mem 9 |
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 response MODE
to set USB response mode where MODE is
- 0: response disabled
- 1: response enabled
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 atten MODE
to set the attenuator mode where MODE is
- 0: None
- 1: 6 bits 0-31,5 dB in 0,5 dB steps connected to the SX1509, active low
- 2: 6 bits 0-31,5 dB in 0,5 dB steps connected to the SX1509
- 3: 6 bits 0-63 dB in 1 dB steps connected to the SX1509
- 4: 7 bits 0-127 dB in 1 dB steps connected to the SX1509
- 5: 8 bits 0-127,5 dB in 0,5 dB steps connected a MCP23017
- 6: 9 bits 0-76,5 dB in 0,5 dB steps connected a MCP23017
- 7: 11 bits 0-106,5 dB in 0,5 dB steps connected a MCP23017
Please also see the Attenuator section below.
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 mcp23017 ADDR
to set the MCP23017 I2C address in hex between 20 and 27. Set it to 0 if not in use.
The most used address is 0x20.
wr pwr INDEX LEVEL
to calibrate the power LEVEL in dBm for INDEX where
- 0: 100 kHz
- 1: 300 kHz
- 2: 1 MHz
- 3: 3 MHz
- 4: 10 MHz
- 5: 30 MHz
- 6: 100 MHz
- 7: 200 MHz
- 8: 280 MHz
- 9: 290 MHz
E.g. to set the level at 100 MHz to 14,5 dBm
wr pwr 6 14.5
Please remember that the level must include the insertion loss of the optional attenuator and low pass filter bank.
Please see the Calibration section below for a more detailed explanation about the calibration.
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.
Calibration
You can calibrate your RFzero to match your specific solution which includes the Si5351A, T1 (the standard transformer, combiner or nothing), attenuator type and low pas filter bank. The signal generator program has a set of general default values measured using a standard RFzero, i.e. T1 is a transformer and no attenuator or low pass filter bank connected.
If you want you can calibrate your setup in the configuration mode using the “wr pwr” command. But you will need a good watt-meter that can measure the power from -20 dBm to 15 dBm. Please also remember to make the measurements with the signal generator set to push-pull, and T1 is either a transformer or combiner.
Example of the maximum output power vs frequency of a typical RFzero.
If you have an attenuator and/or low pass filter bank connected the actual power vs frequency is the maximum power minus the attenuation and insertion loss.
Below is a description of the different frequency intervals, their characteristics and how the power is found.
Below 30 kHz
Below 30 kHz the output power is set to uncalibrated but is typically below -15 dBm.
Between 30 kHz and 100 kHz
Between 30 kHz and 100 kHz the power level is calculated using a hard coded formula. The formula has been made with a curve fit tool. If you want to make your own calibration you can enter your measurements into e.g. MyCurveFit, and see which formula and coefficients have the best fit. The one already in the signal generator is a third order polynomial. Then enter the formula in the
int maxPower(const unsigned int freq);
function located in the global.cpp file.
Between 100 kHz and 290 MHz
Between 100 kHz and 290 MHz the actual power level shown is calculated by interpolating between the power level set with the “wr pwr” command.
Above 290 MHz
When operating the Si5351A high above its 200 MHz maximum frequency sooner or later the PLL will not lock. This means that some output may be present, but it will be highly unstable. At what output frequency this occurs depends on the actual device. However, empirically 280 MHz to 290 is doable for all devices. But the way from 280 MHz over 290 MHz, where interpolation is still used, and towards 300 MHz also shows a steady decline in power as the above picture shows. Due to this behavior the output power above 290 MHz is displayed as uncalibrated.
Hardware
You may use the signal generator program without connecting anything else than a computer to the USB port. However, if you want to have a semi-professional signal generator connecting a display (LCD or graphics), two rotary encoders with push buttons, a 4×4 keypad and two extra push buttons, an attenuator and a low pass filter bank will be a great extension.
The signal generator block schematic showing all the entities.
If you want to attenuate the harmonics you will also need a low pass filter bank which is controlled on D7 to D0 or via the on-board ULN2803A
“Shopping list” and overview of the hardware entities and options.
Entity | Minimum | Medium | Maximum |
---|---|---|---|
RFzero | X | X | X |
Display | X | X | |
SX1509 port expander | X | X | |
Keypad 4x4 | X | X | |
Frequency rotary encoder with push button | X | X | |
RF on/off button | X | X | |
Menu button | X | X | |
Amplitude rotary encoder with push button | X | ||
Attenuator | X | ||
MCP23017 port expander if the attenuator uses more than 7 bits | X |
The 4×4 keypad, rotary encoders with push buttons, display, SX1509 and MCP23017 are available from many sources. The attenuator can be professional surplus, a cheap module or a do-it-yourself type. If you buy a module it might be an idea to find one with mounting holes in it.
Example of expander modules, SX1509 (L) and MCP23017 (R).
The 4×4 keypad, rotary encoders with push buttons, RF on/off push button and Menu on/off push button will effectively make a 5×4 keypad that is connected to the SX1509.
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 SigGen_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.
Entity | Pin | Connected to entity | Connected to pin |
---|---|---|---|
SX1509 | GND | RFzero | GND |
3V3 | RFzero | 3V3 | |
SDA | RFzero | D8 (SDA) | |
SCL | RFzero | D9 (SCL) | |
INT | RFzero | D17 | |
IO0 | Keypad Amplitude rotary encoder | 5 Push button Y |
|
IO1 | Keypad Frequency rotary encoder | 6 Push button Y |
|
IO2 | Keypad RF on/off | 7 Push button Y |
|
IO3 | Keypad Menu on/off | 8 Push button Y |
|
IO4 | Attenuator | Bit 0, LSB | |
IO5 | Attenuator | Bit 1 | |
IO6 | Attenuator | Bit 2 | |
IO7 | Attenuator | Bit 3 | |
IO8 | Keypad | 1 | |
IO9 | Keypad | 2 | |
IO10 | Keypad | 3 | |
IO11 | Keypad | 4 | |
IO12 | Amplitude rotary encoder Frequency rotary encoder RF on/off Menu on/off | Push button X Push button X Push button X Push button X |
|
IO13 | Attenuator | Bit 4 | |
IO14 | Attenuator | Bit 5 | |
IO15 | Attenuator | Bit 6, MSB | |
Keypad (see also note below) | 1 | SX1509 | IO8 |
2 | SX1509 | IO9 | |
3 | SX1509 | IO10 | |
4 | SX1509 | IO11 | |
5 | SX1509 | IO0 | |
6 | SX1509 | IO1 | |
7 | SX1509 | IO2 | |
8 | SX1509 | IO3 | |
Amplitude rotary encoder | GND | RFzero | GND |
A | RFzero | A5 | |
B | RFzero | A4 | |
Push button X | SX1509 | IO12 | |
Push button Y | SX1509 | IO0 | |
Frequency rotary encoder | GND | RFzero | GND |
A | RFzero | A2 | |
B | RFzero | A3 | |
Push button X | SX1509 | IO12 | |
Push button Y | SX1509 | IO1 | |
RF on/off | Push button X | SX1509 | IO12 |
Push button Y | SX1509 | IO2 | |
Menu on/off | Push button X | SX1509 | IO12 |
Push button Y | SX1509 | IO3 | |
MCP23017 | GND | RFzero | GND |
3V3 | RFzero | 3V3 | |
SDA | RFzero | D8 (SDA) | |
SCL | RFzero | D9 (SCL) | |
GPA-GPB | Attenuator | Depends on att. |
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.
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 amplitude or frequency. To make it even easier to remember which keys to use the <B> and <D> keys can be modified using a scalpel so the <B> key will look like an <F> for frequency, and the <D> key will look like an <Enter> key arrow. The <C> key functions a backspace/clear key.
Example of a keypad where the <B> and <D> keys have been modified to look like an <F> and <Enter> arrow by removing the red parts of the letters and a membrane type.
Please note that some keypads may have unused terminals.
Attenuator
If you want to have a variable output from your RFzero you will have to add an attenuator. It can be a simple module or professional surplus found on a flea market. They come in a million different sizes, attenuation ranges and step sizes.
Example of a simple 6 bits, 31,5 dB attenuator in 0,5 dB steps .
Example of a professional 7 bits, 127 dB attenuator in 1 dB steps.
A number of “generic” attenuators have been implemented. More can be added. You can do this yourself or ask for a it to be added. Since there are many different kinds of ways to control RF attenuators this cannot be generalized. Thus it has to be hard coded.
Implemented attenuator types and the attenuator mode.
Max attenuation [dB] | Steps [dB] | Bits | Type | Controller | Pins | MSB | LSB | Active | Mode |
---|---|---|---|---|---|---|---|---|---|
31,5 | 0,5 | 6 | SKY12347 | SX1509 | IO[14:13]+IO[7:4] | IO[14] | IO[4] | Low | 1 |
31,5 | 0,5 | 6 | PE4302 | SX1509 | IO[14:13]+IO[7:4] | IO[14] | IO[4] | High | 2 |
63,0 | 1,0 | 6 | Generic | SX1509 | IO[14:13]+IO[7:4] | IO[14] | IO[4] | High | 3 |
127,0 | 1,0 | 7 | Generic | SX1509 | IO[15:13]+IO[7:4] | IO[15] | IO[4] | High | 4 |
127,5 | 0,5 | 8 | Generic | MCP23017 | GPA[7:0] | GPA[7] | GPA[0] | High | 5 |
76,5 | 0,5 | 12 | RFzero | MCP23017 | GPA[3:0]+GPB[7:0] | GPA[3] | GPB[0] | Mixed | 6 |
106,5 | 0,5 | 16 | RFzero | MCP23017 | GPA[7:0]+GPB[7:0] | GPB[7] | GPA[0] | Mixed | 7 |
I2C, SX1509 and MCP23017
Both the SX1509 and MCP23017, 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.