cancel
Showing results for 
Search instead for 
Did you mean: 

Help- on Using TIM16 with Shared NVIC for 10 ms Interrupts

kumarairia
Associate II

Hello Expert,

 

I am working on an STM32F303VET6 project using the MCSDK. I want to configure TIM16 to generate a 10 ms periodic interrupt . However, I noticed that on this MCU, TIM16 shares its NVIC vector with TIM1 (TIM1_UP_TIM16_IRQHandler), which is already used by MCSDK for motor control.

Could you please advise:

  1. Can I safely use TIM16 for my 10 ms task while TIM1 is used by MCSDK?

  2. If yes, what is the recommended way to handle the shared interrupt? 

  3. Are there any potential conflicts or timing issues I should be aware of?

  4. If the solution could be illustrated with an example, it would make me so happy.

 

In MCSDK- 6.41 , #define TIMx_UP_M1_IRQHandler TIM1_UP_TIM16_IRQHandler

void TIMx_UP_M1_IRQHandler(void)
{
/* USER CODE BEGIN TIMx_UP_M1_IRQn 0 */

/* USER CODE END TIMx_UP_M1_IRQn 0 */

LL_TIM_ClearFlag_UPDATE(TIM1);
R3_2_TIMx_UP_IRQHandler(&PWM_Handle_M1);
TSK_DualDriveFIFOUpdate(M1);

/* USER CODE BEGIN TIMx_UP_M1_IRQn 1 */

/* USER CODE END TIMx_UP_M1_IRQn 1 */
}

0 REPLIES 0