2020-08-07 04:22 PM
I am trying to trigger conversion sequence on the ADC of an STM32H753 using the CC1 output of a timer. My goal is to start a conversion sequence every 25µs. I know that frequency of the CC1 output is correct; I am counting the events with an interrupt. However, on the ADC only a single sequence is triggered. According to the reference manual (RM0433), figure 160, when setting EXTEN to 01 and CONT to 0, then each trigger event should start a conversion sequence. But is isn't.
Here is the code CubeMX generated for initializing the ADC. How do I get this to work?
hadc3.Instance = ADC3;
hadc3.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV6;
hadc3.Init.Resolution = ADC_RESOLUTION_16B;
hadc3.Init.ScanConvMode = ADC_SCAN_ENABLE;
hadc3.Init.EOCSelection = ADC_EOC_SEQ_CONV;
hadc3.Init.LowPowerAutoWait = DISABLE;
hadc3.Init.ContinuousConvMode = ENABLE;
hadc3.Init.NbrOfConversion = 11;
hadc3.Init.DiscontinuousConvMode = DISABLE;
hadc3.Init.ExternalTrigConv = ADC_EXTERNALTRIG_T1_CC3;
hadc3.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
hadc3.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DMA_CIRCULAR;
hadc3.Init.Overrun = ADC_OVR_DATA_PRESERVED;
hadc3.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
hadc3.Init.OversamplingMode = DISABLE;
ADC clock is 24MHz...
Solved! Go to Solution.
2020-08-07 05:02 PM
Never mind, the timer output just was set up wrongly. Never toggled...
2020-08-07 04:24 PM
Ooops. One line should read
hadc3.Init.ContinuousConvMode = DISABLE;
I only can somewhat get it to do something if I set the continuous conversion mode to ENABLE. But that is not what I want...
2020-08-07 05:02 PM
Never mind, the timer output just was set up wrongly. Never toggled...