8 March 2016

Encoders encoding

As I discussed in my posting last night, I spent some time today connecting up all the various data arrays with code. It's all working now, which is a significant chunk of progress, as I now have an end-to-end, profile configured system for the encoders. The same principle can now be applied to the push buttons and the VFO controls. In the latter case it's perhaps less of a valuable exercise, although the thought did occur to me as I was working on the code that the VFO controls could be made configurable to operate any of the Flex "slices" using the same technique. Whether that is particularly useful is a moot point.

I can now build on this code by implementing all 43 Flex control functions. So far I've only done four: audio gain, audio pan, filter width and filter shift. Essentially the others are just minor variations on one or other of the ones I've already done.

What to do about those push buttons?

Hitherto, I've been faffing around with a dual Arduino configuration linked by a serial port. It sounds like a nice idea in principle, providing huge scope for enhancement. But there the benefits end. I'm finding that the controls, notably the VFOs are sluggish in response and after a lot of analysis work I've concluded that the issue is the large number of tasks that the dual processor approach dictates must be done sequentially.

So I'm back to trying to squeeze everything into a single Arduino. There should be no problem with processing power but connectivity is marginal. Each encoder needs three input pins and the display unit gobbles up a massive chunk of 25 pins its wonders to perform. Even with the considerable connectivity of the Arduino Due, it's a bit of a challenge.

My original design called for each of the 16 push buttons to be assigned its own pin and interrupt. Whilst this is simple to implement it's a ridiculously inefficient way to handle an I/O device that may be pushed once in a while. The answer, of course, is to multiplex them. 16 is a handy number from that point of view, because the exceptionally flexible CD74HC4067 is a 16 pin multiplexer. Four address lines are used to select 1 of 16 and a single pin receives the button status. Sixteen pins reduced to five is a good start!

Using the CD74HC4067 approach leaves me just one pin short of what I need. I could explore multiplexing some of the encoders (not the VFOs!) but I'd rather like to avoid that complexity if I can. So I'm on the war path, looking for a pin that I can save from some other task. *

In other news, the equipment case arrived today, so I can start working on panel design in earnest. Still waiting for the slow boat from Hong Kong to deliver my display unit. When that turns up I should have pretty well everything I need to finish the project design. There's still a long way to go.

* As I was writing this Blog entry the solution came to me, proving once again that it is often the act of writing things down that focusses the mind! Each encoder has a built in push button and there is no reason at all why these 8 buttons should not be multiplexed. That saves me 8 input pins, at the expense of one more multiplexer input pin. At a stroke I have six spare pins in my single Arduino implementation. Game on!

No comments:

Post a Comment