Skip to main content
Associate
July 1, 2025
Solved

Comparator to encoder configuration?

  • July 1, 2025
  • 2 replies
  • 345 views

I want to route the internal comparators on the STM32G0B1 to the inputs of the encoder module. I can't find a way to do this in CubeMX. When I select "Encoder Mode" in the timer configuration, there is no option to route the comparators to the timer. Is this configuration possible?

Best answer by TDK

They would be listed in the interconnect section of the Reference Manual. There are some pathways from COMP -> TIM, but none that would enable encoder functionality that I can see. You'd need COMP1->CH1 and COMP2->CH2.

TDK_0-1751390845410.png

 

2 replies

TDK
Super User
July 1, 2025

No, they can't be routed internally to a timer input. You can route them externally using two pins to connect DACx_OUT and TIMx_CHx.

"If you feel a post has answered your question, please click ""Accept as Solution""."
WA_itAuthor
Associate
July 1, 2025

Ok, thanks for the reply. Did you find this documented anywhere or do you just know from experience?

TDK
TDKBest answer
Super User
July 1, 2025

They would be listed in the interconnect section of the Reference Manual. There are some pathways from COMP -> TIM, but none that would enable encoder functionality that I can see. You'd need COMP1->CH1 and COMP2->CH2.

TDK_0-1751390845410.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."