AnsweredAssumed Answered

Use timer to trigger ADC sampling using STM32CubeMX generated code

Question asked by Phataas on Oct 29, 2014
Latest reply on May 26, 2015 by JustAnotherGuy
I have previously used a timer for triggering ADC for sampling using the standard peripheral library. I am now trying out the STM32CubeMX GUI and generating code from it to be used with Keil. I am working on the STM32F429DISCOVERY board.

I get the timer IRQ/ISR running, but the ADC is not triggered. I have read in the ref. manual that timer4 ch4 can be used to trigger a regular group conversion on the ADC. This is what I am trying to do.

What kind of mode is needed to trigger ADC? I can not find any information about this in the reference manual... I used a STM32F103VC earlier and it had to be put in PWM mode (also not explained in the reference manual).

Looking on page 577 in the STM32F429 ref. manual there is a figure "Figure 134. General-purpose timer block diagram" and as far as I can see there is no interrupt from the capture compare that can trigger the TRGO output that is connected to the ADC.

But the ADC says that it can be trigger on a capture compare event.

I have tried comparing with the STMF4 Standard Peripheral Library examples, but no luck.

I have tried output compare mode, PWM and time base without luck.

Anyone been able to use the STM32CubeMX to generate a working example? I would appreciate a .ioc file with a working setup or some more information if possible. I see this question has been asked before when using the standard peripheral library, but not using STM32CubeMX.

Outcomes