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

Lookup table and volume

SigmaDSP & SigmaStudio jackjr Feb 19, 2015 00:00 2 replies Original on forum ↗
Subscribe
jackjr Question
Feb 19, 2015 00:00

Hello,

It's been 2 days I've been trying to use a rotary encoder as volume control for a ADAU1701… without success.

I first tried to use the dedicated rotary volume control.

The only time I got it working was when there was only 3 values in the lookup table. As soon as I added more values, nothing worked anymore.

Then I stumbled upon an alternative way to control volume, without writeback, described here Re: ADAU1701 WP pin always high?

Guess what? Only 3 values in the lookup table worked.

For example, if the starting index is 20, I can only change between 20 and 22.

I joined the test project.

Are there any known bugs with these lookup tables? Or am I missing something?

Thanks,

Jack

lookup table

Audio Signal Processors

adau1401

volume

SigmaDSP Audio Processors

volume control

adau1701

Show More

KJBob Reply
Feb 20, 2015 00:00

Hello Jack,

The difficulty appears to be not in the lookup table itself, but with the integer index which drives it. The rotary encoder conditioning block converts the quadrature encoder output to "up" and "down" pulses, so it was logical to try the circuit described at https://ez.analog.com/message/145882#145882 to generate an index from these pulses. However, that circuit needs some modification to work here. It was intended to operate with straight push-button inputs, where holding a button down would slowly increase or decrease the index. This is done with an integrator scheme (the summation block with feedback adding to itself) which changes the index over time. The encoder conditioning block, however, outputs very narrow "up" and "down" pulses. These pulses are too short to move the integrator output very much, so you get little or no volume change as you rotate the encoder.

The best implementation would involve a digital up-down counter block, however I could not find any in the toolbox other than the GPIO button block, which I could not get to work. Thus I went back to the integrator, while modifying it to work with the one-sample wide pulses from the rotary encoder conditioning block. The resulting arrangement is pictured below:

The integrator now counts in increments of 0.25 in standard analog 5.23 format (which is 1's in 7.21 format). This is converted to integer (28.0 format) to drive the lookup table. You can use your original table with 33 values, or a larger one up to a max index of 63. I tested this project on a ADAU1701MINIZ eval board. Since this board uses I2C instead of SPI and has different MP pin usage, I did not attach the modified project here.

Best regards,

Bob

5305.66f2a6a615b72713d2316b10743e574d.png
5305.66f2a6a615b72713d2316b10743e574d.png
5305.66f2a6a615b72713d2316b10743e574d.png-620x206.png
5305.66f2a6a615b72713d2316b10743e574d.png-620x206.png
jackjr Reply
Feb 20, 2015 00:00

Bob,

It works great.

Thanks a lot!

Regards,

Jack