2024-03-27 12:14 PM - last edited on 2024-03-28 12:09 AM by Peter BENSCH
Hello.
I have plans to implement a motor encoder interface circuit using this micro controller. According to its datasheet, the timer implementation considers TIM1 ~ TIM4.
My question is: which pins can I assign to implement a motor encoder circuit for high resolution (1024PPR) encoder?
The encoder has 2 output pins (A and -A).
Thank you in advance.
Solved! Go to Solution.
2024-03-27 01:22 PM
You mention STM32F1 but tag post as STM32F3, please fix
All the TIM on the F1 will be limited to 16-bit, each has a single counting element.
Encoder mode will use CH1 and CH2 of the respective TIM, for the A/B or +A/-A type inputs.
GPIO and EXTI could be use for a software encoder, with 32 to 64-bit count resolution, for EXTI I'd pair like PB0/PC0 or PA5,PD5
2024-03-27 01:22 PM
You mention STM32F1 but tag post as STM32F3, please fix
All the TIM on the F1 will be limited to 16-bit, each has a single counting element.
Encoder mode will use CH1 and CH2 of the respective TIM, for the A/B or +A/-A type inputs.
GPIO and EXTI could be use for a software encoder, with 32 to 64-bit count resolution, for EXTI I'd pair like PB0/PC0 or PA5,PD5
2024-03-27 01:35 PM
I am not sure encoder you are using. However, here is a tutorial on STM32CubeIDE L298N Motor with STM32F103C8T6. This may help you:
https://www.youtube.com/watch?v=0rbKmkNEdAU
If you ever try to make an Advanced 8-Channel RC Transmitter and Receiver with STM32F103C8T6, you can see here: https://www.pcbway.com/project/shareproject/Advanced_8_Channel_RC_Transmitter_and_Receiver_with_STM32F103C8T6_6b3dc594.html
2024-03-28 04:06 AM
Hello, thank you so much for the information.
About tag, I choose the correct one (STM32F1).
Best regards.
2024-03-28 04:07 AM
Thank you so much for the information!