ARM Cortex-M0+ / compare output / How is OC3REF created at the beginning?

Can anyone tell me how to get the same OC3REF at the beginning as elegantly as possible?

So it's about a timer in compare-match mode… I'm currently setting OC3M to 0b0101 (force high) and then CCR3, and then I set OC3M to 0b0011 (toggle). At first, I had OC3M set to 0b0011 from the start, but then the first pulse was sometimes low and sometimes high… really weird… I don't understand…

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Kelec
1 year ago

Cortex-M0+ is just the Core only the Systick timer is in there.

The remaining timers are peripherals and therefore manufacturers are specifically important to write which uC is.

I suppose it’s any STM32, right?

Kelec
1 year ago
Reply to  LUKEars

I do not know the specific uc but there is an output register for the timers where you can determine the polarity of the OC as well as the current value. You may have to initialize this.

You can also generate and use the code with CubeMX.