cancel
Showing results for 
Search instead for 
Did you mean: 

Dual Interleaved ADC triggered by Timer with DMA

smrtkai
Senior
Posted on January 26, 2016 at 14:14

Hi,

I am using an stm32f4-discovery board and would like to acquire an reflected ultrasound signal with 4 MSPS. To generate the ultrasound signal two shifted pulse signals at 1 MHz are needed. The sampling frequency has to be exactly four times the pulse frequency. Therefore the ADCs need to be triggered by the timer generating pulse signals. Additionally the data should be acquired blockwise using DMA.

In the following figure I have depicted my setup.

0690X00000605KyQAI.png

I tried to configure this with STM32CubeMX but unfortunately I do not know how to configure the trigger of the ADC.

TIM1 is configured to have an update frequency of 4MHz, the 1MHz signals are generated with two channels with ''Output Compare'', ''Toogle on Match'' and a ''Counter Period'' of 1. That's how the shifted pulse signals at 1 MHz are generated.

How do I have to configure the ADC's to get triggered by TIM1? I haven't found the right solution yet.

Thank you for your help in advance.
4 REPLIES 4
Posted on January 26, 2016 at 15:11

I definitely wouldn't do a Period of 1, set the Prescaler to zero, can get the entire division handled in the timer. Don't need toggle. Set the CCRx values 180 out of phase. And make sure the ADC support the TIMx_CHx triggers

Not touching the HAL stuff.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smrtkai
Senior
Posted on January 27, 2016 at 11:38

Thanks, but I need the output signals to be shifted by 90 degrees. The pulse signals are converted to sine- and cosine-wave-signals. With a counter period of 1 and toggling on 0 and 1 respectively, I achieve this shift.

''And make sure the ADC support the TIMx_CHx triggers''. How do I do this?

In an application note or somewhere I read ''dual interleaved mode'' does not work with triggers. Is this true? Or have I misunderstood something? Unfortunatley, I haven't found an example for on synchronizing interleaved adc's with a timer yet.

Posted on January 27, 2016 at 17:12

You can control the phase however you want. You can use two ADC independently, I'd expect.

If you bind them, you'd only be able to trigger the primary, and the phase offset would then be controlled by the ADC clock, and the Two Sampling Delay

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smrtkai
Senior
Posted on January 27, 2016 at 18:28

Okay, that might be another possibility.

I think I have missed a configuration in STM32CubeMX. I can select an external trigger, but I do not know how to activate ''Timer x Capture Compare y event''. And I do not know, where to look it up. Is this just the configuration ''OC1REF'' in the timer configuration?