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?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-01-13 9:25 AM
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-01-13 11:55 PM
> 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
