cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing TIM OCxREF signal

dibs
Associate II
Posted on October 04, 2014 at 22:23

Reference:

RM0090

STM32F407xx Reference Manual

Rev6

Section 17.4.7

TIMxCCMR1->OC1M

--PWM Mode 1,2

Quote:

''2: In PWM mode 1 or 2, the OCREF level changes only when the result of the 

comparison changes or when the output compare mode switches from “frozen�? mode 

to “PWM�? mode.''

Does this mean the the OCxRef signal will be asserted as soon as you select a PWM mode, or only PWM mode 1? I am using PWM2 to trigger a 1-pulse timer while looking at the output on an oscilloscope. The output is indicating that I am getting an extra pulse when I enable the timers, which would be explained by this effect.

Is it possible to clear the OCxREF signal? 

1 REPLY 1
dibs
Associate II
Posted on October 06, 2014 at 15:23

On further inspection, the reason that I was getting an extra pulse out was because I was enabling my one-pulse timer in my init routine.

After doing more testing, it looks like enabling a timer with PWM1 set will immediately set the OCxREF signal. If the timer is set with PWM2, this will not happen.

My original question still is, can you control the OCxREF signal. If I set up an timer with PWM1 and then enable it, it will immediately set the OCxREF signal. If I am using it as a trigger for another timer and do not want the initial trigger to happen, can I somehow kill it before configuring the second timer?