2017-09-04 07:58 PM
Hello, I use MDK-Lite 5.23 uVision / stm32F746BG. I work with two timer interrupts at the same moment: TIM1_UP_TIM10_IRQHandler(void) + TIM2_IRQHandler(void) + program code at the main() function
void TIM1_UP_TIM10_IRQHandler(void)
{ /* USER CODE BEGIN TIM1_UP_TIM10_IRQn 0 *//* USER CODE END TIM1_UP_TIM10_IRQn 0 */
HAL_TIM_IRQHandler(&htim1); /* USER CODE BEGIN TIM1_UP_TIM10_IRQn 1 */ HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_4); /* USER CODE END TIM1_UP_TIM10_IRQn 1 */}/**
* @brief This function handles TIM2 global interrupt.*/void TIM2_IRQHandler(void){ /* USER CODE BEGIN TIM2_IRQn 0 */ HAL_TIM_Base_Stop_IT(&htim2); /* USER CODE END TIM2_IRQn 0 */ HAL_TIM_IRQHandler(&htim2); /* USER CODE BEGIN TIM2_IRQn 1 */ HAL_GPIO_TogglePin(GPIOJ, GPIO_PIN_13); HAL_TIM_Base_Start_IT(&htim2); /* USER CODE END TIM2_IRQn 1 */}int main(void)
{/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();/* Configure the system clock */
SystemClock_Config();/* Initialize all configured peripherals */
MX_GPIO_Init(); MX_TIM2_Init(); MX_TIM1_Init();/* Initialize interrupts */
MX_NVIC_Init();/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim1);HAL_TIM_Base_Start_IT(&htim2); /* USER CODE END 2 *//* Infinite loop */
/* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE *//* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(GPIOJ, GPIO_PIN_14);} /* USER CODE END 3 */}
2017-09-04 08:04 PM
Question: why I get answer from TIMER1 only? (Not from TIM 2, Not from Main() function)
If I Stop TIM1: HAL_TIM_Base_Stop_IT(&htim1);
then I get answer from TIM2 only and nothing from Main() function
what I have to do?
Please, help me.
2017-09-04 08:31 PM
I got new events.
If I start TIM2 first like this HAL_TIM_Base_Start_IT(&htim2);
I get answer from TIM2.
If I start TIM1 first like this HAL_TIM_Base_Start_IT(&htim1);
I get answer from TIM1.
If I do not start TIM1 and do not start TIM2 I get answer from main () function.
Why?
2017-09-13 02:39 AM
Thanks. I understood my problem - it is too high frequency!!!
)))