cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0: Encoder mode + Output Compare

jowakar122
Senior

I am using STM32G071RBT6. I am trying to implement encoder mode + output compare mode using same timer. Right now initially I get OC interrupt even when Tim_CCR3IF flag is 0 and once it get set it remains as it is. 

- Should I combine encoder and OC mode or
- should I use another timer

2 REPLIES 2
KnarfB
Super User

In Encoder Mode, the counter is clocked by encoder events, which are, in general, not periodic. In OC mode, one usually wants some periodic output, but your use case may vary. One timer == one clock, is that ok for you?

Maybe the forum needs more details, see How to write your question to maximize your chance... - STMicroelectronics Community

 hth

KnarfB

@KnarfB 
In my case the timer counter goes from 0 to 2000 and I want an interrupt when it is at 500. I tried using Output Compare No Output mode but did not accomplish it. I am getting interrupts even when the CCR is not matching with the timer's counter.