cancel
Showing results for 
Search instead for 
Did you mean: 

Quadrature encoder interface timestamping

heifetsg
Associate II

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

0 REPLIES 0