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

ADAU1701 difficulty with index-selectable demux

SigmaDSP & SigmaStudio ajs123 Oct 31, 2023 00:00 4 replies Original on forum ↗
Thread Summary

Thread Summary

The user encountered issues with an indexed demux not selecting the correct input based on an aux ADC potentiometer value. The solution involved ensuring the ADC output is multiplied by a value larger than (1-N) to convert the fractional input to an integer within the range 0 to N, and setting the Lookup Table for fractional input and integer output. The final configuration used ADC values 0, 1, 2 to select inputs 0, 1, 2, respectively, without needing a Lookup Table for conversion.
AI Generated Content
Subscribe
ajs123 Question
Oct 31, 2023 00:00

Hi - As shown below, I'm attempting to use the index-selectable demux to bring either of two filters, or a white noise source, to a pair of outputs. I'd like a potentiometer on an auxiliary ADC to make the selection.

Multiplying the ADC value by a DC constant is copied from an example that used an index-selectable filter. The 5:23 format was taken from an example with the demux. I inserted the table lookup for good measure :-). I've tried with 5:23 and 28:0 formats, and with the lookup table set to integer or fractional. Index table values are 1, 2, 3 for inputs of 1, 2, 3.

The demux appears to pass through the first set of inputs regardless of the pot setting (which worked in another example). I also tried the DC value directly to the demux index input.

Any help appreciated!

Screenshot-2023-10-31-at-1.24.22-PM.png
Screenshot-2023-10-31-at-1.24.22-PM.png
ajs123 Reply
Nov 1, 2023 00:00

I solved my own problem through some experimentation. Here's what I found to work:

The indexed demux drequires an integer from 0 to N, where N is the input count. Proper use of the Lookup Table is at least one way of converting a fractional input to integer.

The aux ADC output varies from 0 to 1. The aux ADC value is multiplied by something larger than (1-N), to be sure that the last input can be selected when the pot on the aux ADC is at the full high end. The Lookup Table must be set for fractional input and integer output. To have the demux choose inputs from top to bottom, the Lookup Table output entries are 0, 1, 2 for index values of 1, 2, 3.

Screenshot-2023-11-01-at-2.46.52 PM.png
Screenshot-2023-11-01-at-2.46.52 PM.png
KJBob Reply
Nov 1, 2023 00:00

Hello,

Edit -- sorry it appears our answers crossed, happy that you have it working. Nonetheless, you may find the following information useful for future reference.

It appears that you've tried many modifications yet none of them worked. When this happens, it may help to take a step back and make a simple project to work with the new block (in this case, the mux). For example, this arrangement has a pot selecting among three tones. It works fine:

The Aux ADC output ranges from 0 to just below 1.0 decimal (5.23 format). Presently, the pot is set about halfway, thus ReadBack1 shows 0.5. Multiplying by integer 3 = 1.5 -- this yields integer 1, because the multiplication always rounds down. As the pot is rotated across its travel, the mux control input ranges from 0 to 2. The three-input mux expects this range because its choices are 0, 1, 2 instead of 1, 2, 3. This complication exists everywhere in what I call, "the digital snake pit." As it turns out, a lookup table, though useful in many applications, isn't needed here.

My hardware has a pot wired to MP8, which corresponds to Aux ADC 3. Since your schematic shows Aux ADC 0, evidently your pot connects to MP9, and your HW Config / Register Control setup has MP9 showing Aux ADC 0. If your hardware is actively connected to SigmaStudio via a USB interface, you can use ReadBack blocks to troubleshoot this issue. The x16 gain from the two Gain blocks is needed to read back integers from a -1701, because unfortunately the -1701's Readback register truncates its lowest four bits.

You could download this project, make the necessary changes for Aux ADC 0 and DAC outputs 0 and 1, and see how it runs (add a volume control if needed since the oscillators produce full-scale outputs).

Best regards,

Bob

Mux-AuxADC.dspproj

Mux-AuxADC-sch.png
Mux-AuxADC-sch.png
Mux-AuxADC-hdw.jpg
Mux-AuxADC-hdw.jpg
ajs123 Reply
Nov 1, 2023 00:00

This is hugely helpful! I had been confounded by readback always displaying 0 for my Lookup Table output. I will try this simpler, more direct approach.

To verify my understanding: multiply of a fractional (Aux ADC) and integer (DC source, 28.0 format) value yields an integer output.

KJBob Reply
Nov 1, 2023 00:00

Absolutely! And it takes a pair of Parasaurolophus to pair skate!

Pair-Skate.jpg
Pair-Skate.jpg