2024-07-17 02:04 AM - edited 2024-07-17 02:50 AM
Hello,
With stm32G0, I can capture a pwm frequency and duty cycle using this configuration:
DMA :
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:
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
2024-07-18 09:23 PM
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