cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder pin assign in STM32F103C8T6

claudiohi
Associate II

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

Hello, thank you so much for the information.

About tag, I choose the correct one (STM32F1).

 

Best regards.

Thank you so much for the information!