cancel
Showing results for 
Search instead for 
Did you mean: 

I need to have timer output compare synchronized with timer global interrupt ,they start separately with two lines below HAL_TIM_OC_Start(&htim3,TIM_CHANNEL_2); HAL_TIM_Base_Start_IT(&htim3); but i see 2us difference between them, what I have to do?

mkh
Associate
 
1 REPLY 1

> timer global interrupt

You mean the Update interrupt, as enabled by TIMx_DIER.UIE ?

One edge of the output waveform occurs exactly at the same moment when the Update interrupt is triggered, i.e. when TIMx_CNT rolls over from the value set in TIMx_ARR to 0. However, interrupts are handled by software, and it takes time to execute that software, especially if it's a relatively complex handler as the Cube handlers are.

JW