cancel
Showing results for 
Search instead for 
Did you mean: 

I'd like to know to set the TIMx_CCRy? register, I've configured the

DMore.3
Associate

I've synchronized TIM3 and TIM4, the TIM4 being triggered when the TIM3 Output Compare No Output on channel 2 is active.

I've configured the TIM3 channel 2 as "Output Compare No Output"

In order to control the time delay between TIM3 and TIM4 activation, I've tried to change the TIM3_CCR2 register content to the value 12 (for instance) like that:

__HAL_TIM_SET_COMPARE(&htim3,TIM_CHANNEL_2,12);

but it doesn't work.

I've also set the TIM3 channel 1 as PWM Generation CH1, I'm able change the PWM ratio using the following code line:

__HAL_TIM_SET_COMPARE(&htim3,TIM_CHANNEL_1,12);

but nothing happens when I try to modify the CCR register of TIM3 channel 2, who is set as "Output Compare No Output".

Thanks in advance for your help

1 REPLY 1

> set as "Output Compare No Output".

Oh, the CubeMX gibberish.

> __HAL_TIM_SET_COMPARE(&htim3,TIM_CHANNEL_2,12);

 > but it doesn't work

What is "doesn't work"? How do you know it "doesn't work"? Have you read out and checked both timers' registers?

I'll risk also a guess, related to clicking: If you expect a delayed start, try *not* setting TIM2 to output trigger at all. Does TIM3 start anyway? Then that's your problem.

JW