Volume Control by both Rotary Encoder & Microcontroller - ADAU1467
Hi
I have a working prototype with several rotary encoders controlling the volume of various inputs.
I want add remote control of these using a microcontroller, but I've now realised that there doesn't seem to be a register that holds the current LUT index value for me to alter.
Is there a way of achieving a volume control that can either use a rotary encoder or input from a microcontroller?
It doesn't seem like a big ask, but I've got stuck!
Thanks in advance
Jonathan
Audio Signal Processors
microcontroller
adau1467
rotary encoder
SigmaDSP Audio Processors
Hello Jonathan,
The storage of the current table position is actually not in the Rotary Encoder module itself. So this is why you are having issues finding it.
The Interface Read and Write is the structure that is used to do this. When the rotary encoder detects the counter or counterclockwise motion it reads the memory location that is used for the Interface Read/Write. Then it increments/decrements it and outputs this new setting out of the Interface Write pin that writes to the memory location. The Rotary Encoder then takes this new value and looks up in the table the gain value to use as a gain factor for the volume control. Those gain factors you can see in the Params window. The index position you can see in the Interface Read parameter location.
Here is my program:
Here is the memory location that you can read to find the current setting or write to it to change the setting.
The Interface Read object does show up in the System output files.
Dave T
Brilliant, thanks Dave
Hi Dave
Just to follow up on this one, perhaps something that can go in the development backlog if it isn't already, the Interface Read object used for EEPROM does not appear in the export files, although the memory location does show ok in the GUI
Thanks
Hello Jonathan,
I had performed a system files export and checked that it was in the "params" export file. I pasted the screenshot into my post.
What revision are you using? I am using Rev 4.6
Dave T
Hi Dave
Sorry, I wasn't clear. What you've shown works fine. I'm on Rev 4.6.
The version of interface read that accompanies the EEPROM interface write doesn't show in "params".
I'm using that version to hold the settings when turned off.
Hope that makes sense
Jonathan
Hello Jonathan,
OK, I understand now what you want. It took me a little while and some thinking out of the box to work up a solution.
First part is the setup of setting the volume control index and being able to read and write to it from a controller:
The DC cell is what holds the current value and a microcontroller can write to this and change it. You can do it in the SigmaStudio sequencer to see it work.
Then the micro can read the readback to see the current value. It also can read the setting of the DC cell. Either would work.
Now, for the interface read and write setup.
There is a one shot and feedback to give us a signal that will only last for one sample period.
This is sent to a MUX to switch to the Interface Read in for one sample period so it will pick up the setting from the EEPROM. Then this is sent to two places. To the Interface Write but also to the Parameter Update cell that is configured to write to the DC cell DC1 shown in the first screenshot.
This will set the volume of the rotary volume control. Then after one sample period the MUX will change to the output of the Rotary Encoder cell so now the DC cell and the Interface Write will change it to the new value. If you increment the volume control the same thing will happen. The DC cell will be updated and the EEPROM will be updated.
Here is the example program.
ADAU1452_RotaryEncoder with EEPROM Interface and ability for Micro Read and Write.dspproj
Note for others who might be reading this post and wants to be able to have the program just start with a default value and not have to start from zero and does not need to use the EEPROM interface read and write. Here is a similar version of this program.
ADAU1452 Test of Interface read and write with Default Setting.dspproj
Dave T
Fantastic, thanks Dave
Please log in to reply.




