2020-02-09 07:50 AM
I’m particularly interested in using a single STM32G4 for two 32 bit encoder counters, if that is possible?
Solved! Go to Solution.
2020-02-09 08:21 AM
No. Look at Figure 266 in STM32G4 Series RM0440 Reference manual. Only the first two timer channels are connected to the encoder interface (tim_ti1fp1, tim_ti2fp2).
and "Encoder interface mode acts simply as an external clock with direction selection. This means that the counter just counts continuously between 0 and the auto-reload value in the TIMx_ARR register (0 to ARR or ARR down to 0 depending on the direction)." . So, you cannot use the other channels for PWM.
2020-02-09 08:21 AM
No. Look at Figure 266 in STM32G4 Series RM0440 Reference manual. Only the first two timer channels are connected to the encoder interface (tim_ti1fp1, tim_ti2fp2).
and "Encoder interface mode acts simply as an external clock with direction selection. This means that the counter just counts continuously between 0 and the auto-reload value in the TIMx_ARR register (0 to ARR or ARR down to 0 depending on the direction)." . So, you cannot use the other channels for PWM.
2020-02-09 08:25 AM
TIM might have four channels, but only has ONE counter. So one TIM per encoder, Ch3/Ch4 not usable
2020-02-21 05:16 PM
got it, thanks. STMcube didn't exactly make this matter clear (the maintainer of STMcube might want to adjust that...)