STM32G474VE TIM2 encoder + index
Hello everyone,
I'm encountering a problem with the development of my timer on a STM32G474VE. I have to use the TIM2 in encoder mode + index. I'm using a custom board. I started with a cubeMX project, initialising the timer in encoder + index mode. Due to hardware specification i need to use pins PA0 for TIM2_ETR, PD3 for TIM2_CH1, PD4 for TIM2_CH2. Using these pins, i have a problem with my counter. I have too many resets on a mechanical turn of my encoder. I enable the index interrupt and it is called more than once per turn. I have already checked my signals on a scope and my signals A, B and Z from the encoder are perfectly clean and correct. I temporarily change the configuration to connect TIM2_CH1 to PA5. In this configuration, the timer is perfectly working, so i suppose that I haven't got any problem with my clock configuration or with my hardware since i haven't got any difference in the mapping of PA5 and PD3.
In the STM32G474 documentation I've seen that in the alternate function table, the PD3 AF2 is for TIM2_CH1 and for TIM2_ETR. This is why I'm wondering if PD3 need extra configuration. Is it possible that the microcontroller connects CH1 to ETR and that could lead to extra index call ?
Thanks in advance for your help
