Skip to main content
AASD.1
Associate II
June 6, 2023
Question

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

  • June 6, 2023
  • 1 reply
  • 2814 views


_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.

This topic has been closed for replies.

1 reply

Pavel A.
Super User
June 6, 2023

833 KHz? Really? :face_with_medical_mask:

AASD.1
AASD.1Author
Associate II
June 7, 2023

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

Piranha
Principal III
June 7, 2023

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