AN-951
EXAMPLE IMPLEMENTATIONS OF GPIO IN SOFTWARE
This section provides examples of some commonly used
GPIO conditioning signal flows in the context of a SigmaStudio
project.
The SigmaStudio software is continually updated with new
algorithms, thus the appearance and function of some func-
tional blocks may change over time. However, the ideas
presented in this application note should be applicable in all
future versions of the software.
The information in this application note corresponds to the
Version 3.1 release of SigmaStudio.
PUSH-BUTTON VOLUME CONTROL—
UP/DOWN/MUTE
This example uses two push-buttons to control the pushhold
GPIO cell, which in turn controls volume with a lookup table.
Pressing both buttons simultaneously mutes the audio output.
This example is shown in Figure 20.
Pressing each push-button once increments or decrements the
index. If a push-button is depressed for a duration defined by
hold (ms), the index increments repeatedly at an interval
defined by repeat (ms).
Two GPIO pins, GPIO_0 and GPIO_1, are used as inputs to the
pushhold U1 cell, running the push/hold with a two-button
mute algorithm. The three output pins of this cell, Up Pulse,
Down Pulse, and Mute Pulse, are used as inputs to the look-up
table, UpDownLUT1. Click Table to display the table values.
The table in Figure 19 shows an example of a volume curve
ranging from 0 to 1. Press the Up push-button for the cell to
output the next number in the table. Press the Down push-
button for the cell to output the previous number in the table.
Note that the Up and Down push-buttons are not visible in
Figure 19.
In addition to control inputs and outputs (shown in red in
Figure 20), the lookup table cell has a yellow interface register
input and output, which are linked to the Interface Read and
Interface Write cells. These cells enable writeback of parameter
Figure 20. Push-Button Volume Control –Up/Down/Mute Signal Flow
Rev. A | Page 8 of 20
values from the ADAU1701 to an external EEPROM on power-
down. For more information, see the ADAU1701 data sheet.
For some SigmaDSPs, the interface read and interface write cells
are implemented in software.
The lookup table output is sent as a control input to the SW
volume cell. This cell also has two audio inputs (green) and two
audio outputs (blue). The control input takes a value from the
table and scales the audio accordingly. When a push-button is
pressed, the table outputs a new value, and the volume cell slews
to this new value based on the SW slew rate entered in the cell.
Figure 19. Push-Button Volume Control–Up/Down/Mute Index Table
Application Note
Need help?
Do you have a question about the AN-951 and is the answer not in the manual?
Questions and answers