STM32H7, end of period interrupt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-01 12:11 AM - edited ‎2024-05-01 4:21 AM
Hi, I'm using a timer to create a software delay on a high prio task (HPTask with FreeRTOS).
The MCU used is STM32H755ZI.
My target is:
- use a timer and arm an interrupt which duration will be 250 usec;
- suspend the HPTask
- on the timer END PERIOD interrupt restart the HPTask
To reach this result I used TIM17 and OnePulse API.
This is my setup on main from CubeMX:
htim17.Instance = TIM17;
htim17.Init.Prescaler = 200;
htim17.Init.CounterMode = TIM_COUNTERMODE_UP;
htim17.Init.Period = 10000;
htim17.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim17.Init.RepetitionCounter = 0;
htim17.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim17) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_OnePulse_Init(&htim17, TIM_OPMODE_SINGLE) != HAL_OK)
{
Error_Handler();
}
This is my setup to generate the delay:
HAL_TIM_Base_Init(&htim17);
HAL_TIM_Base_Start_IT(&htim17);
HAL_TIM_OnePulse_Start(&htim17, 0U);
Now... I reached something that is usable but not exactly what I want.
The interrupt receives two events. Before to start and at the end of the pulse.
Is it possible (also adopting different strategies) to get only on single interrupt at the end of the period?
Thank you in advance,
C.
Solved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-05 11:13 PM
My mistake, lack of knowledge on this framework...
Remove the OnePulse setup and start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-05 11:13 PM
My mistake, lack of knowledge on this framework...
Remove the OnePulse setup and start.
