cancel
Showing results for 
Search instead for 
Did you mean: 

ST community Hello, my question is I want to use two generic interrupts on STM32F302R8T6 but one of them is not working. TIM6->DIER |= (1<<0); TIM2_IRQHandler works when I comment out this part. How to use global truncation for both?

ENGIN TANRIKULU
Associate III


_legacyfs_online_stmicro_images_0693W00000bjDZWQA2.png

2 REPLIES 2
gbm
Lead III

I suspect the problem here:

NVIC->ISER =

NVIC->IP[...] =

This definitely doesn't do what you think. IP registers are accessed as 32 bits, and a single register contains 4 priorities for 4 interrupts.

Use NVIC_EnableIRQ() and NVIC_SetPriority() instead of your home-made code.

Don't use the TIMx->SR &= forms, use TIMx->SR = mask, it clears the interrupt and is safe

If the interrupt doesn't clear properly it will reenter/saturate, but that doesn't look to be the issue here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..