Post Go back to editing

How to configure potentiometers

Hi, 

My ADAU1701 DSP board have 3 potentiometers connected to MP3, MP8 and MP9 into the AUX-ADC input.-

I have uploaded a capture from the developer's example.

This is for master volume control. 


And this is for filtering I suppose:

I would like to know the importance of DC input entry and it's format. Is it always the same value? it depends on the pot utilized?

Also, as I am a complete illiterate in this matter I would like to understand the cells needed here. I assume the AnalogDigitalConverter (pot) modifies a DC current (dc block) and it's product (multiply block) affects a 2nd order filter with Lookup.

Regarding the master volume, is there any easier way to implement it? I really dont understand all the cells and blocks.

Lokking forward to your help

  •      Hello,

         To learn the blocks which require an external input is to learn the number formats expected by these blocks.  These are described here.  Below I'll explain how they work with an example.

         Your potentiometer routes a physical voltage roughly between 0 and 3.3 V to the MP input, where the Aux ADC converts this to an eight-bit number between 00000000 and 11111111 (0 - 255 in base 10).  In turn this leaves the GPIO's schematic terminal as a decimal (5.23 format) number -- that is, five bits before the binary point and 23 after -- which ranges from 0 to 0.995 -- it doesn't go all the way to 1.0 as it's limited by the eight-bit resolution.

         Such a decimal "5.23" number is the same format as the audio signals themselves -- these numbers can go from -16 to +15.9999 in base 10.  Blocks which are made for a decimal input, such as the Slew External Volume block shown, accept the positive half of this range.  A decimal number greater than one provides gain, although we often limit the control input to 0 -- 1.0 so the control only attenuates.

         On the other hand, the externally controlled Index Filters accept an integer (28.0 format) index consisting of the very lowest bits of the DSP's internal registers. To scale the Aux ADC output into an integer range, multiply it by an integer number equal to the desired maximum integer.  It gets a little confusing because, for example, a 20-step index filter accepts an input of 0 - 19 -- not 1 - 20.  An actual input of 20 over-ranges the filter, resulting no sound or worse.  In practice, multiplying an Aux-ADC input by 20 results in a zero -- 19 integer, because the Aux ADC never quite reaches 1.0, so it's OK.  However, I've been known to, for example, make the filter index range 21 and simply not use the highest curve only to be safe.  But that's just me.

         Using Readback blocks as shown help with troubleshooting control inputs. The -1701's readback register truncates its four lowest bits, so to see an integer number you need to multiply by 16 first.

         Back to the volume control:  Although what's shown above works, its linear adjustment from nothing to full sound results in a lopsided acoustical feel -- most of the adjustment range is crammed into lowest portion of pot rotation. Often this is fixed with a Lookup Table or Linear Interpolator.  You'll find examples of this by searching the forum, here's one.

         Note that the above explanation applies to older DSPs like the -1701.  The -1452 and above uses expanded number formats, and the Aux ADCs directly output a 10-bit integer instead of a decimal format.

         Best regards,

         Bob

  • Thanks for you reply! I've read the info several times, and still trying to properly understand it. 

    I will keep reading it until it sinks in. Anyways, the examples shown volume adjustments with a 28.0 format and a 35 sptes LUT works properly for me (I just copied the example shown)