Question
Detecting interrupt routine execution time greater than interrupt period at runtime
Posted on September 26, 2015 at 09:45
I was just wondering if the following is a reliable/reasonable method for FW to detect at runtime whether another timer interrupt has been fired, before servicing of the prior timer interrupt (i.e. execution of the code called by the interrupt) has been completed.
if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) { TIM_ClearITPendingBit(TIM3, TIM_IT_Update); // Do my things here // when finished, following test whether execution period was longer than TIM3 interrupt(?) if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) { TimingProblem=true; }}In other words, to detect if code execution is taking longer than the interrupt period?Thanks