cancel
Showing results for 
Search instead for 
Did you mean: 

How can I process the TIM12 update interrupt in TIM8_UP_TIM13_IRQHandler? - MCU: STM32F767 -

pabian
Associate III

The TIM12 update interrupt is not occurred in TIM8_UP_TIM13_IRQHandler().

However it is occurred in TIM8_TRG_COM_TIM14_IRQHandler()

I configured TIM12 update interrupt as below;

//TIM4: master -> TIM12: slave

void  MX_Test_TIM4_TIM12(void) {

  NVIC_EnableIRQ(TIM8_UP_TIM13_IRQn);

  __HAL_RCC_TIM12_CLK_ENABLE();

  __HAL_RCC_TIM4_CLK_ENABLE();

  TIM12->ARR = 16000;        // slave timer period

  // trigger selection TS=001 ITR1 = TIM2, slave mode SMS=0111 external clock mode 1

  TIM12->SMCR = TIM_TS_ITR0 | TIM_SMCR_SMS_0 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_2;

  TIM12->DIER = TIM_DIER_UIE;   // interrupt on update event (timer overflow)

  TIM12->CR1 = TIM_CR1_CEN;    // enable timer 3

  TIM4->PSC = 54;         // prescaler preload

  TIM4->EGR = TIM_EGR_UG;     // update prescaler

  TIM4->ARR = 250;        // master timer period

  TIM4->CR2 = TIM_TRGO_UPDATE;  // master mode selection MMS=010 Update event

  TIM4->CR1 = TIM_CR1_CEN;    // enable timer 2

}

Let me know why TIM12 update interrupt is occurred in TIM8_TRG_COM_TIM14_IRQHandler()?

2 REPLIES 2

Why would be TIM12 interrupt associated with TIM8_UP_TIM13 ? Imo it should be associated with TIM8_BRK_TIM12 - see NVIC chapter in RM0410.

Check if the vector table in startup code / disassembly matches that in the RM.

JW

pabian
Associate III

Thanks,

I misunderstand that TIM8_UP_TIM13_IRQn is an update interrupt from TIM8_IRQn to TIM13_IRQn like a EXTI9_5_IRQn (EXTI5_6_7_8_9).