2022-05-26 02:48 PM
I am trying to create a 50ms timer using the above reference. The clock is 16MHz, I have a divisor of 16 and have the NVIC enabled (all this is done in cubeMX). I have the following ISR
void HAL_LPTIM_AutoReloadMatchCallback(LPTIM_HandleTypeDef *hlptim)
{
hlptim1.Instance->ISR |= (LPTIM_ICR_ARRMCF | LPTIM_ICR_CMPMCF);
}
Prior to the while 1 loop I call:
HAL_LPTIM_Counter_Start_IT(&hlptim1, 50000);
It doesn't appear to me to be working correctly.....At start up I get into the ISR and count is way less than it should be....Can someone tell me what I am doing wrong? This should be pretty simple as I just want the timer to count to 50ms (using 16mhz with /16) and every time it rolls generate an IRQ....
Solved! Go to Solution.
2022-05-27 11:32 AM
Turns out the timer was being clocked at some very slow rate as another FW person touched it ....This has been solved...Thank you
2022-05-27 07:37 AM
> At start up I get into the ISR and count is way less than it should be....
Is LPTIM stopped upon breakpoint in its respective DBGMCU freeze register?
JW
2022-05-27 11:32 AM
Turns out the timer was being clocked at some very slow rate as another FW person touched it ....This has been solved...Thank you