Boot Status of Index Selectable Multiplexer
Hello,
I hope someone can help. I have an ADAU1701 here, which I love. However, with a Pushbutton connected to GPIO1/MP1 I try to switch and Index Selectable Multiplexer. It switches different states such as "Stereo", "Left only", "Right only", "Mono" and does this fine. However, when I boot up the board, "Stereo" which is the first switch part should be on, but "Left" is on, or sometimes "Right". Also when I reupload the program, each time the switch position is one step further. So when I e.g. write four times the program into the ADAU1701 every fourth time it is "Stereo".
How can I set the MUX to start at position one when the board boots up ?
Thanks in advance.
Edit Notes
Typing corrections.
[edited by: holger75 at 6:38 PM (GMT -5) on 27 Feb 2022]
Audio Signal Processors
SigmaDSP Audio Processors
adau1701
Hello,
This one turned out to be a bit more difficult than expected. First, from your description it appears you would like your pushbutton counter to always start out at zero. The Interface Read and Write blocks are designed along with the -1701's Write-Back function to remember the state from the last power down -- for example, the volume can be made to come back to its previous level over a power cycle. For this to work the hardware must trigger a Write back before power is completely lost. Since in your case you wish to always begin in Stereo mode, don't use the Interface Read and Write blocks. Someone smarter than me on EZ discovered that you can substitute a Feedback block for the Interface blocks to prevent any memory.
Next, you need to match the type of PB Counter to your hardware pushbutton signal. If the button grounds the MP input as shown below, either use the Falling Edge version of the PB Counter, or else invert the MP input in HW Config and use the Rising Edge version.
My first attempt worked fine when I Link-Compile-Downloaded it. Yet when I tried self-booting, it always started on the second Mux input. I took awhile fo figure out why. I believe it's because at boot, the GP input starts out at zero (as if the button were pressed) until its 20mS debounce time expires, then goes to the expected high state. The PB Counter interprets this as a button press, thus at boot it always went to the 2nd input. The fix is to disable the pushbutton for the first 30 mS of operation after boot. I used a Timer as shown to perform this function. Now it works reliably. Note that I’m using the rising edge PB Counter with an inverted GP input — the disable logic would need rework for the falling-edge version.
I attached the project below, of course you'll need to adapt the ins and outs to your own hardware. The ADAU1701MINIZ eval board I'm using doesn't have a working Write Back trigger so I could not test a memory version of this project.
Best regards,
Bob
PB-Mux-no-rem.zip
Thanks a lot for the great help, it works perfect that way.
Best regards,
Holger
Please log in to reply.

