cancel
Showing results for 
Search instead for 
Did you mean: 

LPTIM1 STM32L476RG (nucleo)??

SWenn.1
Senior III

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

0693W00000NqjVUQAZ.png 

1 ACCEPTED SOLUTION

Accepted Solutions
SWenn.1
Senior III

Turns out the timer was being clocked at some very slow rate as another FW person touched it ....This has been solved...Thank you

View solution in original post

2 REPLIES 2

> 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

SWenn.1
Senior III

Turns out the timer was being clocked at some very slow rate as another FW person touched it ....This has been solved...Thank you