The MAX2870 signal generator is an inexpensive RF signal source covering from 23.5 MHz to 6000 MHz. While the touch colour LCD interface is fine and works well, sometimes there arises situations where software control would be useful. To address this, a simple Windows GUI control application was written in C# which interfaces to the signal generator via the onboard USB-serial port.
When plugged into a PC USB port, the signal generator looks like a serial COM port. Looking in the Device Manager in Windows shows what COM port number has been assigned. To avoid having to look into the Device Manager to find which COM port number has been assigned, the application queries the Device IDs of all the serial ports searching for the text 'CH340' - which - hopefully - is unique to the MAX2870 serial port.
The actual serial protocol was found in the public domain on the internet and built into the application.
A couple of examples using an external 10 MHz reference clock are given for the command to be sent at 115200,8,N,1 - where 'HH' is an 8-bit hexadecimal value...
2000.456 Mhz +5dBm 'Point' Frequency command (11 bytes):AD 01 01 01 01 86 A0 1E 86 48 C3
...where 'AD 01' is the command ID for a MAX2870, '01' indicates a 'Point' frequency command, '01' is the '+5 dBm' output level (where the power setting is one of +5 dBm, +2 dBm, -1 dBm and -4 dBm, numbered 0x01, 0x02, 0x03 and 0x04 respectively), '01 86 A0' is the reference clock frequency expressed in increments of 100 Hz (0x0186A0 = 100,000 = 10 MHz / 100), '1E 86 48' is the spot frequency expressed in kHz (0x1E8648' = 2000456 = 2000.456 MHz / 1000). The command is ended with a checksum (0xC3) - which is the modulo sum of all the preceding bytes in the command.
100 MHz to 200 MHz, step 1 MHz 'Sweep' Frequency command +2 dBm (18 bytes):
AD 01 02 02 01 86 A0 01 86 A0 03 0D 40 00 27 10 01 88
...where 'AD 01' is the command ID for a MAX2870, '02' indicates a 'Sweep' frequency command, '02' is the '+2 dBm' output level (where the power setting is one of +5 dBm, +2 dBm, -1 dBm and -4 dBm, numbered 0x01, 0x02, 0x03 and 0x04 respectively), '01 86 A0' is the reference clock frequency expressed in increments of 100 Hz (0x0186A0 = 100,000 = 10 MHz / 100), '01 86 A0' is the start frequency expressed in kHz (0x0186A0' =100,000 = 100 MHz / 1000), '03 0D 40' is the stop frequency expressed in kHz (0x030D40' =200,000 = 200 MHz / 1000) and the '00 27 10' is the step frequency (10,000 decimal), expressed in Hz or kHz - depending on the following byte ('01' = Hz, '02' = kHz), which in this case is '01' so the step frequency is 10,000 Hz, i.e., 10 kHz. The command is ended with a checksum (0x88) - which is the modulo sum of all the preceding bytes in the command.
No command fragment was found for setting the step delay, and so it is fixed to the default value of 10 ms.
An example setting of the application is shown below. The setting for the 'Ext. Ref. Freq.' is 10.000000 MHz instead of the nominal 25.000 MHz applicable for the onboard crystal oscillator. The 10.000 MHz setting is for a modification where an external frequency reference is input to the MAX2870. In the case at HawkRAO this is a Rubidium Frequency Source (RFS) set to 10.000000 MHz
NOTE: this example is provided solely for illustrative purposes of what can be done and provide motivation to readers for writing their own application. The application will not be available publicly (nor privately under a 'wink, wink, say no more' scenario). I have neither the time nor the inclination to make sure all parties from which the information was gathered are given credit - not to mention copyright issues.
Do not ask for a copy as a non-response may offend.
That being said - it is not too difficult an application to code.