cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing PWM with DMA in indirect mode on Channel 3 and 4

JulienD
Senior

Hello,

 

With stm32G0, I can capture a pwm frequency and duty cycle using this configuration:

JulienD_0-1721206758698.png

DMA : 

JulienD_1-1721206796134.png

 

Now, for pinout reasons, I want to do the same thing using channels 3 and 4 instead of channels 1 and 2 but I can't find a correct set of settings.

On page 626 of the reference manual, I see this diagram:

 

JulienD_2-1721209604299.png

At first sight, I though I could use TI3FP3  (red) coming out from tim_ch3 as trigger but at second sight (I mean: after the board is in production.... :D) , I see that only TI1FP1 and TI2FP2 (yellow) are available for triggering...

 

Is it possible ? If yes, what's the trick? Of course the goal is to keep everything on the hardware side (indirect mode + DMAs)

 

Thanks

Julien

 

 

1 REPLY 1

As you've already found out, you can't use CH3/CH4 to reset the counter. However, you still can use them to capture opposite edges of the same signal, store them using DMA, and subsequently calculate period and duty from the stored values. 

JW