Skip to main content
GFont.1
Associate III
April 1, 2020
Question

LPTIM as a pulse counter

  • April 1, 2020
  • 1 reply
  • 783 views

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();

     }

This topic has been closed for replies.

1 reply

GFont.1
GFont.1Author
Associate III
April 1, 2020

detail

HAL_LPTIM_Init(&hlptim1) return HAL_OK