Home » Blog » Projects » Electronics Projects » Signal Generator Remote Control over USB Serial

Signal Generator Remote Control over USB Serial

signal generator remote control

Adding signal generator remote control increases its capabilities and usefulness.

You can use any terminal program to connect to your signal generator over its USB serial port. Just connect the signal generator Arduino to USB, and set your terminal program to the right serial port and 9600 baud. Also, make sure that you include a line feed as the terminator for each command sent. The source code is available in a previous article.

Whenever you connect the signal generator remote control will wait for your commands. The command to start remote control is “+” and to end serial control is “X”. The software does not care whether your commands are upper or lower case. It also contains error checking and will tell you if it receives bad data. After processing a command successful, the signal generator remote control returns with an “OK”.

If you are using a terminal program, you may want to turn on Verbose communication. If you do, the signal generator will provide more descriptive information back to you. However, if you want to write another program for signal generator remote control, leave Verbose off. It is much easier to write software to understand non-verbose responses.

The signal generator remote control has been written to make it easy for you to use the AD9850 as a frequency synthesizer or VFO in a homebrew radio receiver or transmitter. For example, you can set an Offset frequency for different modulation modes and intermediate frequencies.

Examples of popular terminal programs include the serial port terminal built into the Arduino IDE, Realterm, or Multi Terminal shown above.

Just so you know, whenever you connect to the Arduino on the serial port, the device will do a “reset” back to the default values stored in the EEPROM.

Signal generator remote control command set

Without further ado, here is the complete command protocol for signal generator remote control contained in the Arduino sketch posted recently. All responses are indicated in their non-verbose form and are terminated by a line feed. All commands and responses are shown in uppercase.

Functions Commands Details
Serial Connection + Connect, X Disconnect
Frequency F? Read Frequency
F=n Write FrequencyU Write Increase Frequency
D Write Decrease Frequency
n is an integer between 100 and 30000000 (Hz)

U and D move the frequency up or down by one increment

Tuning Increment I? Read Increment
I=n Write Increment
n is an integer between 0..6, with 0=1Hz, 1=10Hz up to 6=1MHz
Mode M? Read Mode
M=n Write Mode
n is an integer between 0..2 with 0=Off, 1=On, 2=Sweep
Offset O? Read Offset
O=n Write Offset
n is a positive or negative integer to create a frequency offset from the displayed frequency. Default 0 Hz.
Calibration C? Read Calibration Factor
C=n Write Calibration Factor
n is a positive or negative integer used to calibrate the clock in the AD9850. Default 0 Hz.
Sweep W? Read Sweep Status
W=n Write Sweep Status
WP=a,b,c,d,e Write Sweep Parameters
n is an integer between 0..3 with 0=Off, 1=On, 2=Pause, 3=Resume
See note below on Sweep Parameters
EEPROM S Save configuration to EEPROM
L Load configuration from EEPROM
EEPROM stores Frequency, Increment, Offset, Calibration and Sweep Parameters. These are automatically loaded when Arduino starts or resets.
Verbose V=n n is an integer between 0..1 with 0=Off and 1=On

For setting Sweep Parameters:

  • a and b are the Sweep Lo and High frequencies respectively, same as the n in F=n
  • c is the frequency increment, same as the n in I=n
  • d is the dwell time in milliseconds for each frequency in the Sweep, between 1..10 milliseconds
  • e is the number of loops or cycles to be performed by the Sweep, between 1 to 100

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.