2017-02-20 09:23 AM
The microcontroller i am using is a STM32F446.
The STM32F446 is equipped with 3 ADCs.I would like to start one conversion of all 3 ADCs at the same time (simultaneous/synchronized start).I do not want to use DMA.I would like to start the conversions by software (no external trigger) and to poll if the conversions of all 3 ADCs have finished.Is this possible and how do i have to configure the ADCs for doing this?I searched all given examples by CubeHAL and StdPeriph_Lib but didn't find anything that fits.Searching the internet for 'Triple regular simultaneous mode, -DMA' and things like that was also quite disappointing.Any help is greatly appreciated2017-02-20 09:44 AM
So Triple mode, non-continuous, non-triggered, non-scanned, all ADC configure with same/equivalent settings. Then start the conversion at each instant you want an answer.
Should be able to read ADCx->CDR, just like it would if you'd used DMA, waiting for EOC on one of the ADC
Assume the 'internet' isn't going to have code for everyone's unique situation/use case. Should be able to use a 3-UP example with minimal modification to do the manual trigger/start.
2017-02-20 10:52 AM
Asking for perfect synchronisation, in a first step for debug purpose, would use the IO pin ADC trigger (I guess using it as GPIO output and toggling it by SW would kick-in the 3 adc at once. Then use a timer channel to do the job internally.
With or without DMA, have a look at this thread:
2017-02-24 06:24 AM
Hey guys!
Thanks for your replies.
I am still starting all 3 ADCs in a sequential way like this (because this is the easiest way for me :(
...
SET_BIT(ADC1->CR2,(uint32_t)ADC_CR2_SWSTART);
SET_BIT(ADC2->CR2,(uint32_t)ADC_CR2_SWSTART);SET_BIT(ADC3->CR2,(uint32_t)ADC_CR2_SWSTART);...
I will build up a small test circuit where each ADC will convert the same analog signal.
With this test i will figure out if the small time delay between each ADC start will effect my measurement or if it is neglectable.
If it is not neglectable i will try to start the ADC conversions synchronized by using a timer as suggested by KIC8462852 EPIC204278916.
2017-02-24 12:09 PM
If you disable/enable interrupts during the kick off sequence it will probably meet your needs without unforeseen side effects.