cancel
Showing results for 
Search instead for 
Did you mean: 

LPTIM as a pulse counter

GFont.1
Associate III

Hi, bom dia.

I need to use LPTIM as a pulse counter in stm32L431. I created a project using stm32cubeIDE and start only the necessary to test the LPTIM, but when i call HAL_LPTIM_Counter_Start() or HAL_LPTIM_Counter_Start_IT() never return HAL_OK. I have tested change all configurations, but dont work. Please help me, thanks.

Mode: standalone : counts external clock events

LPTIM_HandleTypeDef hlptim1;

static void MX_LPTIM1_Init(void);

if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 1000) != HAL_OK){

     HAL_UART_Transmit(&huart3, (uint8_t*)"error\n", 6,HAL_MAX_DELAY);

     Error_Handler();

     }

1 REPLY 1
GFont.1
Associate III

detail

HAL_LPTIM_Init(&hlptim1) return HAL_OK