2020-11-02 12:25 AM
Hi,
I'm using the STM32G474 in dual BLDC driver application.
I'm operation the encoder interface at X4 mode. For RPM calculation I would like to time stamp every transition event i.e. encoder count + timestamp.
Timers in use: TIM1/8 - PWM, TIM2/3 - hall sensors, TIM4/5 - encoder interfaces.
The idea is to use 2 DMA channels - one for the encoder counter and the other for the timestamp.
The question is how to produce the DMA trigger. I understand that I can link a slave timer and reset a slave timer every increment of the encoder. The slave timer can trigger the DMA.
Unfortunately, because this is a dual motor driver most of the timers are in use and I can't attach a slave timer to every encoder timer.
I've managed to create such DMA trigger by using capture event but this raised an event every 4 ticks in X4 mode.
Is there an option to implement this without a slave timer?
Can I use HRTIM for that purpose?
I would be happy for ideas
Thanks