ΣSigmaStudio Ask AI Русский Log in

Pot Controlling a Multiplexer

SigmaDSP & SigmaStudio ByronS Jun 19, 2013 00:00 3 replies Original on forum ↗
Subscribe
ByronS Question
Jun 19, 2013 00:00

Another part of my application requires the use of a Pot fed into an A/D input so that it can control the audio path selected by a mux. The idea is to select 1 of several different compressors with different noise gates, but for now to make testing easier, the compressors have been replaced by sinewave generators as the signal source so the path selection is easier to see on the scope.

The reason I'm trying to use the tolerance analyzers at the front end is so that I can have a larger portion of the Pot rotation selecting a given signal path. By this I mean the first 1/4 rotation will select one audio path, the second 1/4 rotation the next, etc.

I can get the A/D input to work fine with the tolerance analyzers, but I don't seem to be setting up the numbers properly in the lookup table. I've read numerous posts and understand that the lookup table needs values in 5.23 format. I believe I understand the number format coming out of the Buffers is in 28.0 format, so I'm applying the formula of N(5,23) = N(28.0) x 2^-23 and putting those into the table. The index selectable mux is still only choosing the first audio path so I always end up with a 1KHz tone output.

There are likely many ways that are better to set this up than this, so I'd really appreciate other suggestions on the method. What's wrong with my lookup table numbers?

ADIApproved Reply
Jun 19, 2013 00:00

Hi ByronS,

I described how to do this without a lookup table on page 14 of application note AN-951, which you can find here: http://www.analog.com/static/imported-files/application_notes/AN-951.pdf

You basically just multiply the ADC input signal by the number of indices in 28.0 format, and the rounding that results from the multiplication does all the work for you!

The implementation is quite simple and it saves quite a few instructions compared to the approach involving an index lookup table. Please give it a try!

ByronS Reply
Jun 19, 2013 00:00

Thanks Brett........that's too easy! Not to drag on this discussion, but I'd still like to understand why the 28.0 formated output from a buffer block doesn't control the mux after using the lookup table. If I'm calculating the lookup table values correctly with the formula listed above and using the 28.0 formatted number coming out of the buffer block in the calculation, I would expect the index selectable mux to select the channel properly. Am I missing something basic again?

ADIApproved Reply
Jun 20, 2013 00:00

Byron,

The numbers in your index table need to be 0, 1, 2, 3, converted from 28.0 to 5.23. To do this, take n5.23 = n28.0 * 2^-23.

In your example, to use a slew multiplexer with four indices, the 4 table entries should be:

0

1.19209289550781E-07

2.38418579101562E-07

3.57627868652343E-07

For more info, see page 11 of application note AN-951: http://www.analog.com/static/imported-files/application_notes/AN-951.pdf