2020-05-09 09:06 PM
Hello I have NUCLEO-G474RE running at 170Mhz (24Mhz HSE [div 6] [mul 85] [div 2]) .
I am using Master and TimA $ TimC hrtimer as PWM for SMPS running at 100kHz (10uS).
I want to check how much available time for me if I interrupt every period and update the duty cycle using compare unit.
I add an IO to check the duration, it took around 7.44uS??
So that means I have only left around 2.65 uS for my code?
void HRTIM1_Master_IRQHandler(void)
{
/* USER CODE BEGIN HRTIM1_Master_IRQn 0 */
GPIOC->BSRR = (1<<10); // up
/* USER CODE END HRTIM1_Master_IRQn 0 */
HAL_HRTIM_IRQHandler(&hhrtim1,HRTIM_TIMERINDEX_MASTER);
/* USER CODE BEGIN HRTIM1_Master_IRQn 1 */
GPIOC->BSRR = (1<<26); // down +16
/* USER CODE END HRTIM1_Master_IRQn 1 */
}
Solved! Go to Solution.
2020-05-25 12:15 PM
HAL_HRTIM_RepetitionEventCallback() is an empty function (unless you put some code in there), so it will execute very fast. Why would you call it?
2020-05-25 01:55 PM
To replace
HRTIM1_Master_IRQHandler(void)
which includes
HAL_HRTIM_IRQHandler(&hhrtim1,HRTIM_TIMERINDEX_MASTER);
which is around 4uS.
If I use the call back instead, which I haven't tested yet, would it be better, ie less overhead?
2020-05-28 10:04 PM
Check the source of HAL_HRTIM_RepetitionEventCallback() in the HAL sources. What is in there?