2013-07-24 11:40 PM
I need to setup the ADC -> DMA to transfer at exactly 44100 hz. (Audio quality)
I have setup the DMA -> DAC by setting the clock to TIM_Period to 1088 (48Mhz / 1088 = 44117) But i dont seem to have this control over the ADC clock.Im attempting a signal processor ADC >> DMA (Process the signal) >> DMA >> DACBut i am having trouble syncronising. Any help would be appreciated.Cheers. #stm32f0-adc-dma-sample-rate2013-08-02 02:58 PM
2013-08-02 05:07 PM
It's a bit of a mess, and mix of thoughts.
You want to trigger the ADC with the TIM, the ADC does not need to be in continuous mode. You are trying to tie the two to a common rate. You do not want the ADC/EOC interrupt. The TIM14 is 16-bit, you're not using it as a trigger.2013-08-03 02:15 PM
Sorry Clive, this code has reminnets of my experimenting trying to get this working. I initially combined to examples, the ADC DMA and the DAC Signal generation example with the hope of getting a ADC -> DAC loop back. The first thing i tried was
while (1)
{
while((DMA_GetFlagStatus(DMA1_FLAG_TC1)) == RESET );
for(i = 0; i < ARRAYSIZE(Sine12bit); i++)
{
Sine12bit[i] = RegularConvData_Tab[i];
}
DMA_ClearFlag(DMA1_FLAG_TC1); // DMA_ClearFlag(DMA1_FLAG_TC3);
}
But pretty much the same results as the interrupt.
I figured i had enough time CPU cycles between a single DMA transfer to process the buffer provided i had the sample rates synchronized. But as it would appear the is the wrong approach.
I certainly feel your right about the continuous mode. I had a feeling this was tripping me up.
As with the sample rate on the ADC.
It would appear to me that i cannot just use any timer to trigger the ADC but i must be misreading the manual.
I will give it a go and get back.
Cheers