2024-03-14 05:54 AM - edited 2024-03-14 06:47 AM
Hi all
I have some problem using the Break interrupts (BK1 and BK2). When activated it keeps firing the break interrupt handler: TIM1_BRK_IRQHandler
We have measured the BK1 and BK2 signals and the states are as they scould be when activayted/deactivated and there are no noise on the lines.
The BK1 and BK2 is setup in the Timer1 with correct polarity etc.
The PWM's are stopped when activated, but the interrupts handler keeps getting called!
Did I miss something in the handler?
void TIM1_BRK_IRQHandler(void)
{
// Reset Master Output Enable on motor timer - aka Coast
htim1.Instance->BDTR &= ~(TIM_BDTR_MOE);
htim1.Instance->SR &= ~(TIM_SR_BIF);
Beef::Pal::Stm32h7xx::MotorIsr::ExecuteBreakInterruptHandler();
HAL_TIM_IRQHandler(&htim1);
}
It is a STM32H730
Any idea what causijng this or is it just the way Break inputs are working?
I could disable interrupts in the handler and reactivate it when starting the PWM again`?
Thomasa
2024-03-14 06:44 AM
Which STM32?
JW
PS. Not the source of issue you've described, but don't use RMW to clear TIMx_SR flags.
2024-03-14 06:46 AM
Hi
Sorry, I forgot the type. It is a STM32H730.
Thomas
2024-03-14 07:33 AM - edited 2024-03-14 07:33 AM
Essentially the same note applies:
So the question is, is the break source persistent? If yes, disable break interrupt in TIMx_DIER and reenable it only after the break source has been cleared.
JW