Method to control the full scale output of the DAC (volume control) ?
Hello,
I use the DAC together with the DMA in circular mode to generate a sinewave of a few Hz. A buffer is filled with the predefined values of one sine period. The frequency is adjusted with the DAC clock and the sine amplitude by updating the sine buffer. Currently I am using the "half/full buffer transmitted" flags of the DMA to multiply the sine table by a gain value by SW. It works well, however I wonder if there is a simpler way to control this "volume" to modify the amplitude of the sinewave.
I would like to avoid cascading external DAC and rather take benefit of the STM32 peripherals and the high performance of the H7, and to limit cost too.
My problem with the current method is that I can only refresh the gain once per period and the application would probably take benefit of a better dynamic.
Using the OPAMP with the PGA coule be a solution but it must be "linear controlled".
An HW solution like VCA or by using a second external DAC are for the moment my alternatives.
Let me know if you know a better solution.
Thanks