2016-01-26 05:14 AM
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. 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.2016-01-26 06:11 AM
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.2016-01-27 02:38 AM
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.2016-01-27 08:12 AM
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 Delay2016-01-27 09:28 AM
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?