cancel
Showing results for 
Search instead for 
Did you mean: 

OC1M set active/inactive on match immediatly changes output

Svan .41
Associate II

In the capture/compare ISR, I want to program the next CCR1 value and the associated action: to change the output to active or inactive when CNT matches CCR1. For this I need to set TIM1_CCMR1 OC1M to 0001 or 0010.

However, as soon as I program OC1M with 0001, the output becomes active (and inactive on 0010). It ignores the CNT/CCR1 matching condition?

10 REPLIES 10
Svan .41
Associate II

The jitter is due to HSI16. The RC oscillator is too inaccurate. Will try a crystal instead. Thank you for your insight!