26 April 2016

The Flex returns

Yay! My 6500 returned from its sojourn to DL today and it now receives stuff on those bands with the fast wiggles, aka, 12m and 10m. Or at least it would if there were any signals to hear - the higher bands have been dead as a doornail up here in the snowy north recently.

So I'm back to developing the radio interfaces. Fortunately, all the programming I did during the time that the 6500 was on holiday seems to have worked without breaking any of the existing radio interfaces. Next up is band and mode management, closely followed by Tx/Rx control, slice management and so on.

Meanwhile, I have made a start on display processor to control processor comms. This is needed for, amongst other things, band/mode selection from the display touch screen.

In the end I decided to use the same byte-wide parallel port and protocol that I developed for the control -> display interface. It seems to work well for data to the display processor and I have sufficient spare I/O pins on both processors for separate channels for each direction. I've run out of jumper leads to connect up the second channel though, so I ordered a big bag of them on eBay yesterday. I fully expect to have bi-directional comms up and running by the end of the week.

23 April 2016

Touchy feely

The past week has been a bit busy with other things but I have managed to get some more coding done. Notably, I have written much of the background stuff needed to enable touch control. At the moment I have only implemented a single touch command, which switches between displaying VFO-B frequency and the split value (VFO-B - VFO-A) in kHz.

The touch facility is made somewhat more complicated by the multi-page support that the new display provides. This means that touch controls have to be mapped to specific pages as well as to the active area on the screen. Most of the code to manage all this has now been written, so adding further touch areas should be relatively trivial.

Along the way, as I needed to develop the display page management code for the touch screen logic, I started programming the band-change / direct frequency entry page. This is a separate page that is selected by one of the physical push buttons and which permits direct access to a band or direct frequency entry to the nearest Hz. The complete logic chain, from push button press to display page switching is now working nicely. That may not sound like much but there are quite a few system elements that all have to work together for it to happen!


Displaying VFO-A & VFO-B
frequencies
The embryonic band change page
Displaying the VFO-B split










A bit of a lash up!












I've also connected up a couple of encoders, so that I can test the switching logic properly. All seems to be working fine but the controller hardware is now becoming something of a rats nest of wires, so I don't think I'll be able to add much more hardware until I get the front panel back from CNC cutting. This is, however, quite an important step, as it is the first time that every type of peripheral has been connected up at the same time. Slowly but surely, the problems are being ironed out, with more and more of the project working.

In other news, the Flex radio has been fixed and is on its way back to 'WGV Towers, so I should have it all connected back up by early next week. 

16 April 2016

Coding fun

I've managed to spend some time on the software side of the project recently. With the rig away, I am somewhat limited in what I can do but there is a whole class of data processing and display management that is not related to the radio interface at all.

So I've been working on the display logic for the encoders and switches. I integrated the switch multiplexer software that I'd developed separately into the main control program and that is working just fine. I've also written most of the code to do with managing the encoder functions display. That is turn is linked into the switch multiplexer so that a switch pushed on the mux shows up as a change in encoder function and that change is properly reflected on the display.

All this is completely soft, of course. The key to how it all connects together is the profile file, of which there can be as many as one might ever want. Here's my current default profile file:



* G3WGVFlex controller default profile
* Note: files must follow 8.3 naming convention
* See FlexFunctions.h for list of control function names

********** 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
Shift1
/Encoder

Encoder 3
Shift0
Shift1
/Encoder

Encoder 4
Shift0 8
Shift1 8
/Encoder

Encoder 5
Shift0
Shift1
/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
Slice 0
MaxValue 5
MinValue 40
StepValue 1
/Control

Control 9
Enabled No
/Control

Control 10
Enabled No
/Control

Control 11
Enabled No
/Control

Control 12
Enabled No
/Control

Control 13
Enabled No
/Control

Control 14
Enabled No
/Control

Control 15
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
Step 5
/VFO

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

********** SWITCHES

Switch 0
Enabled No
/Switch

Switch 1
Enabled No
/Switch

Switch 2
Enabled No
/Switch

Switch 3
Enabled No
/Switch

Switch 4
Enabled Yes
Name Menu
Function swMenu
/Switch

Switch 5
Enabled No
/Switch

Switch 6
Enabled No
/Switch

Switch 7
Enabled No
/Switch

Switch 8
Enabled No
/Switch

Switch 9
Enabled No
/Switch

Switch 10
Enabled No
/Switch

Switch 11
Enabled No
/Switch

Switch 12
Enabled No
/Switch

Switch 13
Enabled No
/Switch

Switch 14
Enabled No
/Switch

Switch 15
Enabled No
/Switch

Switch 16
Enabled Yes
Name VFO-Rx
Function swVFOAReceive
/Switch

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

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

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

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

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

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

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

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

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

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

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




Because of the flexibility that this approach offers, we can more or less make any control perform any function. So, for example, it is logical that the push switch on the encoder should change that encoder's function but there is nothing to say that it has to be so. Any of the 28 push buttons (16 ordinary buttons, eight encoder push buttons and four Tx/Rx control buttons) can be configured to perform that, or indeed any other operation.

This approach makes the code much more complex and some parts of it have been a complete sod to debug. My excuse is that the Arduino development environment is rather poor on debugging tools, in fact nearly non existent. That's mainly because the development is done on the PC but the program is then uploaded to the Arduino for running, where there is no diagnostic function other than a serial monitor.

The idea of being able to have a completely different physical panel configuration for, say a contest and another one, perhaps, for DXpeditioning and yet another for every day DXing is an intriguing one and it will be very interesting to see how that all works out. Another cool idea is that you could have different layouts for, say left-handed and right-handed operators. I pioneered this user configuration concept many years ago in my DXpedition logging software, StarLog, so it's interesting to now be doing the same thing with hardware configuration. All the fundamentals are there now and it is encouraging to see how it is all coming together.

I think the next coding area to start on is the touch screen. I did some very early work on this, really just to demonstrate that I could see touch transactions. The idea of having a touch screen on an amateur radio transceiver is a completely new one for me. I suspect it will take some time to find the sort of things it might be useful for.

One thing I already thought about is that by touching the VFO-B area it could bring that VFO into use, or switch it back off again. Another neat trick would be to change the frequency indication to instead show the split value - useful in DXpedition pileups. I'll build a software test harness for this over the next few days and see where it gets me to.

13 April 2016

Front panel

I've finally completed the front panel layout for my development controller. In the end I decided to go for a completely symmetrical layout, consistent with the fact that effectively all VFOs are created equal in the Flex world.

The picture shows the cutting layout and was a bit of a sod to get right. The main problem is the mix of units: component pins are on 0.1" spacing, whilst virtually everything else is in metric. The result is a lot of to-ing and fro-ing between the inches and mm. At least Visio makes that relatively easy to do!

The final front panel cutting layout for the
G3WGV Flex controller project
The large rectangle in the middle is the 5" TFT touch screen, which is really the centre of operations.  Around that are two banks of four pushbuttons and eight rotary shaft encoders. Either side of the central assembly are the two VFOs, each with their own set of pushbuttons and Tx/Rx LED switches, a la FT5000. To the far left are the power switch, paddle input, headphones out and microphone connectors.

The next task is to get Visio to create an AutoCad file, which I shall e-mail to my friendly CNC milling machine owner tomorrow. It'll probably be next week before I can get the panel to him and as he always seems to be ridiculously busy it might be some time before all those holes are cut. At least sending him the file gets it in the queue...

After that, it'll be into the local paint shop to be sprayed dark grey with a matt finish. I think I've more or less decided that the small amount of silk screening is probably not worth bothering with - as virtually all the controls are "soft" and can be reconfigured at will, there is no value in labelling them. Instead, the display will show what the various shaft encodes are configured to do.

I'm holding off cutting the rear panel for now. I don't have clear visibility of what will be needed on the rear and even less idea what would be a good layout at this stage. As it's the back panel and it will certainly be much simpler that the front panel, I shall probably do the metal bashing for that myself.

For the moment, I've rather run out of things I can do. It's supposed to be a nice day tomorrow... aviating beckons, I think.

Or perhaps not

Just as I thought I was back on the Flex controller project I discovered a fault on the Flex radio itself. On 15m/12m/10m it was stone deaf. I'd noticed that I wasn't hearing signals on those bands but had put it down to poor conditions until I decided to do a A/B comparison with my FT5000 on 12m. After some excellent support, first from Martin Lynch and then from Flex itself, we identified that there is a problem with the amateur bands preselector/front end filter. So the radio's gone off to Flex's European support centre in Germany. I guess it'll be away for a week or so.

Meanwhile, the CPLD display arrived on the (quite quick!) slow boat from Hong Kong, so I've managed to get a bit of preparatory work done with the new display and updated drivers. It's all straightforward enough but there are quite a few changes associated with the new set-up, so it's probably just as well that I didn't get too far into the project before changing course.

I'm also working on the somewhat tedious but entirely necessary front panel layout. This starts off life as a drawing in Visio and will end up as an AutoCAD Exchange (*.dxf) file that the CNC milling machine can understand. Once it's let loose on the file, there's no going back, so measure twice, cut once is most definitely the order of the day!

I hope to have more interesting things to write about in the next couple of weeks.

7 April 2016

Hiatus concluded

After a couple of weeks away I am now back on the project. In the meantime a few changes have occurred that will have a bearing on how future development progresses.

The most disruptive aspect is that the display technology I am using is going through significant change. The software drivers are being substantially updated, providing a number of very useful new features that I would like to include in my design. Amongst other things, this will permit me to use a range of different fonts for the various parts of the display. The update also brings improved performance and more mundane capabilities that will make the software easier to write, such as text alignment and the ability to determine string display size.

A further development is that, having gained experience with the current display I have decided to go for a different unit. The current unit is a single "page" display, which means that new screens have to completely overwrite the existing screen. This adds complexity when there are potentially multiple screens, e.g. Main, Menu, Configuration, etc.

I have therefore ordered a new display based on Complex Programmable Logic Device (CPLD) technology. Amongst other things, the CPLD display provides up to eight pages that can be recalled non-destructively as required. This will significantly reduce the amount of coding required. The device is on the slow boat from Hong Kong as I write this missive.

The upshot of all this is that software development is on hold pending the arrival of these new items. I therefore plan to get on with the hardware design aspects, with a view to getting the front and rear panels into the workshop for CNC milling in the next few days.