29 June 2016

Profile editor

One of the most powerful aspects of the Flex controller design is that the layout is completely soft - it can be changed at will, just by loading a new profile. I always envisaged that any particular physical layout could have multiple different profiles for specific application - contests, DXing, DXpeditions, etc. and, of course, the profile concept also means that any hardware layout can be accommodated without needing to resort to programming.

All well and good, but over time, the profile file has become quite complex as ever more features have been added and it has long been clear to me that manually editing it was not where its future lay.

I've spent the last few days writing a Windows app, appropriately called Profile Manager. This promises to change everything, making it trivial to try out new hardware layouts and create new profiles for a given hardware set up. It's now good enough that I'm happy to share the concepts here.

Profile Manager representation of my Mk 1 controller
The basic principle is that each possible control has an icon that can be placed anywhere on the screen, thus representing the physical layout of the controller. Controls that are not needed can be hidden and the window can be adjusted in size to represent its physical counterpart.

All controls: switches, rotary encoders, VFOs and the LCD display can be individually configured for a particular profile. The controls are then linked up to their functions via pop-up windows when a control is selected. This makes it very easy to visualise what the final product will look like and, of course is very simple to use.

The switch configuration pop-up window
Once the design is completed, a profile file is created by the program for direct uploading to the controller. I haven't quite decided how to do this yet - ideally I would use FTP over Ethernet but there is a bit of an issue with that because the controller usually has a dynamic IP address. The less appealing, but simpler alternative is to upload using the RS232 port on the Arduino.

Of course an existing profile can be cloned and then altered to suit and saved as a new profile. This makes the profile manager really quite powerful, making trial layouts easy to build and test. Once uploaded, the controller has the ability to select one of the multiple profiles in a matter of seconds.

Creating a mini controller layout
I had a lot of fun developing this profile manager app! Firstly, it's nice to get back to PC application development in the highly productive environment of Delphi XE. It's also been stimulating to see the original concept develop over the past few days into a much more capable app than I had originally envisaged. The Windows code and the profile files it produces have now got somewhat ahead of the controller code, so that's where I need to focus next.

25 June 2016

RSBG Convention update

This is the somewhat witty title and précis for my presentation at the HF Convention in October:

SDR with knobs on!

Traditional radios are being overtaken by SDR technology and it is said that the mouse and keyboard are the front panel of the future. We look at the opportunities, issues and alternatives, using a home brew SDR controller project as a case study.


I hope to see many of my Blog followers there.

A slow week

After last week's excellent progress, this week has been rather the opposite. Partly that's because I've been busy with the annual inspection on my aircraft (rather like an MOT on steroids) and I've spent a lot of time at the airport fixing ground-based radio systems.

The new display shield arrived and I have done some initial testing. Rather disappointingly, it has heralded the return of my SPI issues, for reasons that I cannot for now fathom. The problem is slightly different - now the Ethernet or the SD card break the display subsystem. I need to find some quality time to investigate further.

And that is about it. I hope to have a little more progress to report next week.

18 June 2016

Lots of new code

The last week has seen very good progress on the programming front. I've added lots of new control functions, including control of VFO lock, APF, noise blanker (normal and wide) and ANR. All these functions have two components, on/off and level, so they each have the option to allocate a rotary encode and a switch to the function. All this is under the direction of the Profile file, so any switch (hardware or software) and any encoder can be optionally set to provide each function.

I've also taken the opportunity to tidy up a lot of the original code to bring it up to the same programming standards as the later code. Early code necessarily tends to be rather messy and fragmented, so it's a good plan to revisit it later in the project!

I thought you might be interested in an overall view of the development environment I am now running...


In the background you can see the Maestro, which is running on 6m and is the SSDR client. My controller is working with the Maestro and shows the same information. In front of the Maestro you can see the PCB, now fully populated with push buttons and encoders. In front of that is the controller stack, comprising an Arduino Due processor, Ethernet shield, LCD shield and LCD display.

Just in front of the Maestro you can perhaps see some ribbon cable sets, constructed ready for full hardware implementation on the PCB. These will connect the PCB to the processor stack in due course. You can also see a small toggle switch to the right of the PCB. This is the power control switch, which is completely software driven, as I discussed a while back.

With all these additions the default profile is now significantly more complex than it was a couple of months ago.



* G3WGVFlex controller default profile
* Note: files must follow 8.3 naming convention
* See FlexFunctions.h for list of control function names
* Manually updated: 2016-06-17

********** ENCODERS
* Encoder Shift0 & Shift1 values are the associated
* Control number

Encoder 0
Shift0 1
Shift1 2
/Encoder

Encoder 1
Shift0 0
Shift1 3
/Encoder

Encoder 2
Shift0 11
Shift1 12
/Encoder

Encoder 3
Shift0 9
Shift1 10
/Encoder

Encoder 4
Shift0 8
Shift1 15
/Encoder

Encoder 5
Shift0 13
Shift1 14
/Encoder

Encoder 6
Shift0 4
Shift1 5
/Encoder

Encoder 7
Shift0 6
Shift1 7
/Encoder

********** CONTROLS

Control 0
Enabled Yes
Name Volume-A
Function setAudioGain
Slice 0
Shift 0
MaxValue 100
MinValue 0
StepValue 1
/Control

Control 1
Enabled Yes
Name Width-A
Function setRxFiltWidth
Slice 0
MaxValue 10000
MinValue 100
StepValue 10
/Control

Control 2
Enabled Yes
Name Shift-A
Function setRxFiltShift
Slice 0
MaxValue 2000
MinValue -2000
StepValue 10
/Control

Control 3
Enabled Yes
Name Pan-A
Function setAudioPan
Slice 0
MaxValue 100
MinValue 0
StepValue 1
/Control

Control 4
Enabled Yes
Name Volume-B
Function setAudioGain
Slice 1
MaxValue 100
MinValue 0
StepValue 1
/Control

Control 5
Enabled Yes
Name Pan-B
Function setAudioPan
Slice 1
MaxValue 100
MinValue 0
StepValue 1
/Control

Control 6
Enabled Yes
Name Width-B
Function setRxFiltWidth
Slice 1
MaxValue 10000
MinValue 100
StepValue 10
/Control

Control 7
Enabled Yes
Name Shift-B
Function setRxFiltShift
Slice 1
MaxValue 2000
MinValue -2000
StepValue 10
/Control

Control 8
Enabled Yes
Name CW-speed
Function setCwSpeed
MaxValue 5
MinValue 40
StepValue 1
/Control

Control 9
Enabled Yes
Name TX-Power
Function setRfPower
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 10
Enabled Yes
Name Tune-Power
Function setTunePower
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 11
Enabled Yes
Name RIT-A
Function setRitFreq
Slice 0
MaxValue 10000
MinValue -10000
StepValue 10
/Control

Control 12
Enabled Yes
Name XIT-A
Function setXitFreq
Slice 0
MaxValue 10000
MinValue -10000
StepValue 10
/Control

Control 13
Enabled Yes
Name RIT-B
Function setRitFreq
Slice 1
MaxValue 10000
MinValue -10000
StepValue 10
/Control

Control 14
Enabled Yes
Name XIT-B
Function setXitFreq
Slice 1
MaxValue 10000
MinValue -10000
StepValue 10
/Control

Control 15
Enabled Yes
Name CW-pitch
Function setCwPitch
MaxValue 300
MinValue 1000
StepValue 10
/Control

Control 16
Enabled Yes
Name APF-A
Function setApfLevel
Slice 0
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 17
Enabled Yes
Name APF-B
Function setApfLevel
Slice 1
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 18
Enabled Yes
Name NB-A
Function setNbLevel
Slice 0
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 19
Enabled Yes
Name NB-B
Function setNbLevel
Slice 1
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 20
Enabled Yes
Name WNB-A
Function setWnbLevel
Slice 0
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 21
Enabled Yes
Name WNB-B
Function setWnbLevel
Slice 1
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 22
Enabled Yes
Name NR-A
Function setNrLevel
Slice 0
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 23
Enabled Yes
Name NR-A
Function setNrLevel
Slice 0
MaxValue 0
MinValue 100
StepValue 1
/Control

Control 24
Enabled No
/Control

Control 25
Enabled No
/Control

Control 26
Enabled No
/Control

Control 27
Enabled No
/Control

Control 28
Enabled No
/Control

Control 29
Enabled No
/Control

Control 30
Enabled No
/Control

Control 31
Enabled No
/Control

********** SLICES

Slice 0
Name VFO-A
/Slice

Slice 1
Name VFO-B
/slice

Slice 2
Name Slice-3
/slice

Slice 3
Name Slice-4
/slice

********** VFOs

VFO 0
Enabled Yes
Name VFO-A
Slice 0
/VFO

VFO 1
Enabled Yes
Name VFO-B
Slice 1
/VFO

********** SWITCHES

Switch 0
Enabled Yes
Name VFOA-Band
Function swVFOABand
/Switch

Switch 1
Enabled Yes
Name VFOA-Mode
Function swVFOAMode
/Switch

Switch 2
Enabled Yes
Name ConfigDump
Function swConfigDump
/Switch

Switch 3
Enabled Yes
Name VFOA-Lock
Function swVFOALock
/Switch

Switch 4
Enabled Yes
Name VFOA-Rx
Function swVFOAReceive
/Switch

Switch 5
Enabled Yes
Name VFOA-Tx
Function swVFOATransmit
/Switch

Switch 6
Enabled No
/Switch

Switch 7
Enabled No
/Switch

Switch 8
Enabled No
/Switch

Switch 9
Enabled No
/Switch

Switch 10
Enabled Yes
Name Encoder-0
Function swEncoder0
/Switch

Switch 11
Enabled Yes
Name Encoder-1
Function swEncoder1
/Switch

Switch 12
Enabled Yes
Name Encoder-2
Function swEncoder2
/Switch

Switch 13
Enabled Yes
Name Encoder-3
Function swEncoder3
/Switch

Switch 14
Enabled Yes
Name Encoder-4
Function swEncoder4
/Switch

Switch 15
Enabled Yes
Name Encoder-5
Function swEncoder5
/Switch

Switch 16
Enabled No
/Switch

Switch 17
Enabled No
/Switch

Switch 18
Enabled No
/Switch

Switch 19
Enabled No
/Switch

Switch 20
Enabled Yes
Name VFOB-Rx
Function swVFOBReceive
/Switch

Switch 21
Enabled Yes
Name VFOB-Tx
Function swVFOBTransmit
/Switch

Switch 22
Enabled Yes
Name VFOB-Band
Function swVFOBBand
/Switch

Switch 23
Enabled Yes
Name VFOB-Mode
Function swVFOBMode
/Switch

Switch 24
Enabled No
/Switch

Switch 25
Enabled Yes
Name VFOB-Lock
Function swVFOBLock
/Switch

Switch 26
Enabled Yes
Name Encoder-7
Function swEncoder7
/Switch

Switch 27
Enabled Yes
Name Encoder-6
Function swEncoder6
/Switch

Switch 28
Enabled No
/Switch

Switch 29
Enabled No
/Switch

Switch 30
Enabled No
/Switch

Switch 31
Enabled Yes
Name Power
Function swPower
/Switch



Eventually, it will be possible to have multiple profile files and switch between them at will, making the panel layout completely user configurable. More code required!

13 June 2016

General progress report

I see it's almost ten days since I updated the Blog and that will never do! This is what I've been up to:

The single Arduino architecture is now working fully (that is, it has all the functionality that the last version of the dual processor solution had). That's encouraging, as it means the architecture model is pretty well fully validated now. I do not expect to be changing again! (but see below...)

The PCB has been fully populated with push buttons, the two multiplexer chips and eight encoders. The multiplexers and switches are all working and I'm just waiting for a couple of components to arrive so that I can finish the connections, to encoders, VFOs and the VFO LED switches. Meanwhile, the front panel shouldn't be too much longer in the machine shop.

I've written some new code in the Arduino and a separate Windows Delphi application that lets me upload profile and configuration files to the on-board memory card. Previously, if I made changes, I had to remove the SD card from the Arduino stack, plug it into my PC, copy the new file across and then put the SD card back in the Arduino. Something of a palava and I am happy not to have to do that any more.

Finally, I've been looking into the possibility of displaying a panadapter/waterfall on the Flex Controller display. This is not as easy as it appears at first sight. The Flex radio shapes the FFT data to a specified width and height in pixels for the controller to display. That's marvellous but it makes it very difficult to support more than one panadapter display unless they happen to have identical dimensions. That is unlikely, especially with the relatively small screen on my controller. For the time being, Flex Radio has, understandably, ducked the issue, although there is talk of support for multiple FFT displays at some stage in the future.

Of course this isn't a problem if the controller is being used in parallel with SSDR - probably the most common configuration. It would, however, be quite nice to have a pan display when the controller is operated in stand-alone mode. Experiments have shown that unfortunately the Arduino Due processor and, particularly the display just do not have sufficient power for this to work in practice. So I've reluctantly decided that my controller will not have its own panadapter or waterfall display.

This in turn has started me thinking about the possibility of a mark II controller. There is a huge choice of single board computing systems out there, including some astonishingly powerful machines that would eat the FFT data display problem alive. The big problem is the quite serious amount of I/O that the controller needs and in that regard the Arduino is excellent. Something that combines the connectivity of Arduino with the processing power of a modern multiprocessing engine is what is needed. Something like this, perhaps!

This is what always happens when I start developing things. I can always see the next couple of versions stretching out into the future. I suppose that's the reason I've been building things since I was a kid and programming since my early 20s!

4 June 2016

RSGB Convention

*** BREAKING NEWS ***

I have been invited to give a presentation on the work I am doing with SDR controllers at the HF Convention in October. Early days yet but I am expecting the session to be some time on Saturday 8th October. My outline plan is to explore the concept of radio control via Ethernet, looking at issues and solutions, using my Flex Controller project as a (hopefully!) working example.

I suppose I'd better get on with it then!

Architecture rethink II

I think I've pretty well concluded the architecture rethink discussed last week. After a lot of scratching around in the drivers and libraries that manage the SPI, I now have a version that works with all necessary elements needed to move to a single Arduino architecture.

It'll take a while to reconfigure the software to accommodate this change but I already have VFO frequency and S-meter displays working, so I don't see any particular issues apart from coding effort required.


 At the moment I am using the rather ungainly hardware stack shown above. When the new display interface board is available in a few weeks time it will be possible to tidy this up considerably - the display will be mounted on the new PCB and connected to the display interface board via a standard 40 way "IDE" ribbon cable.

So, barring any unexpected setbacks I think I can safely say that I have, at last, settled on the best and hopefully final architecture for my Flex Controller.

PCB arrives

The PCB has arrived! And very smart it looks too. I plan to start populating it with components this weekend in between handing out a few points to NFD stations.

The front panel is not yet available but it hardly matters, as the PCB holds virtually all the front panel controls. Once the panel arrives it'll be a simple job to attach the PCB to complete the physical implementation. A major step forward for the project.