cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743zit6 After the timing interrupt is enabled, the interrupt callback function is executed repeatedly, and other programs cannot be executed?

AASD.1
Associate III


_legacyfs_online_stmicro_images_0693W00000bVhZ9QAK.png

  • CUBEMX Settings as above:
  • The callback function is as follows:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
 
{
 
	if(htim->Instance == TIM2)
 
	{
 
		LL_GPIO_TogglePin(CLK_GPIO_Port,CLK_Pin); 
 
	}
 
}
  • The call code is as follows:
USB_printf("1");
 
HAL_TIM_Base_Start_IT(&htim2);
 
USB_printf("2");
  • The result is shown below:


_legacyfs_online_stmicro_images_0693W00000bVhbyQAC.pngAfter receiving 1, the serial assistant no longer receives it and has no reaction when stuck, the pin turns over normally, and the callback function executes normally.

4 REPLIES 4
Pavel A.
Evangelist III

833 KHz? Really? :face_with_medical_mask:

I want to output a 4MHz frequency clock signal.Can't it do that?

For such purposes timers have output channels, which can generate PWM. Read the reference manual and application notes.

Good day.

I do what you suggest,it works.But it can noly generate PWM,if i use HAL_TIM_PWM_Start_IT() to start PWM,it will happen the same thing.Now i have to turnover other pin's level(its frenquency is different form PWM) when the PWM turnover.How can i do it?

Thanks for your suggestions.