ADAU1701: Enable/disable sine generator with GPIO
Hi,
I want to enable or disable a sine generator block by changing a GPIO to high or low state. Any ideas how I can do this the best way?
Audio Signal Processors
SigmaDSP Audio Processors
adau1701
Hello,
Since the sine wave oscillator has no control input pin, we need to switch its output instead. Here's a commonly used way:
The Single Slew External Volume Control provides a "soft" ON and OFF characteristic -- it ramps the level up and down instead of a sudden switch. This minimizes a "clicking" sounds when the GPIO input changes state. You can control how slowly the ramping works by entering a number in the text box. The higher the number, the slower the transition. If you're interested in how this number translates to the actual slew rate, please see this thread.
If instead your application needs "instant" ON-OFF response, substitute a simple multiplier (under Basic DSP / Arithmetic Operations) for the slew volume control.
Controlling the sine wave after the source means you get random phase at the ON and OFF switching moments, which is acceptable in most applications when slew is used. If you need zero-cross switching, that's rather more complex.
Best regards,
Bob
Please log in to reply.