2016-10-21 09:27 AM
Hi,
I am having ADC3 bring in input from the microphone and I want to just the gain (amplitude) by 2 and then send it out through one of the DAC channels. So far, I have ADC and DAC synced through TIM8 and TIM6 respectively at 48kHz.When I dont have any gain adjustment and route input to output, I am alright. But when I try to just the gain my multiplying a scalar with each value of the stored ADC, I get random output on the DAC.I am implementing this multiplication in the ADC Conversion complete function as follows:void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc3){if(hadc3 -> Instance == ADC3) { mValues[0]=aADCxConvertedValues[0]>>1; mValues[1]=aADCxConvertedValues[1]>>1; HAL_DAC_Start_DMA(&hdac, DAC_CHANNEL_2, (uint32_t *)mValues, 2, DAC_ALIGN_12B_R); }}Is there a different technique I can try? Are there any app notes or any other ST resource anyone can point me to? #adc #dac #stm32f103 #gain2016-10-23 06:33 PM
Bumping this to see if I can attract a response..