Skip to main content
Associate
Jul 1, 2025 1:31 PM UTC
Solved

Comparator to encoder configuration?

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?

This topic has been closed for replies.
TDK
TDKBest answer
Jul 1, 2025 5:34 PM UTC

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""."

3 replies

TDK
Jul 1, 2025 1:43 PM UTC

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
Jul 1, 2025 2:53 PM UTC

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

TDK
TDKBest answer
Jul 1, 2025 5:34 PM UTC

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""."