LPTIM1 one-shot mode does not work
I am using the LPTIM1 to aquire a sensor measurement trough interruption each T period. When I set it in continous mode (reference manual says: To enable the continuous counting, the CNTSTRT bit must be set) everything works out well.
HAL_LPTIM_TimeOut_Start_IT(&hlptim1, LPTIM1_PERIOD, LPTIM1_TIMEOUT);
LPTIM1-> CR |= 0x00000005; // Enable and software trigger LPTIM1 in continuous mode
However, I want to set it in single-shot mode (reference manual says: "To enable the one-shot counting, the SNGSTRT bit must be set). So I write:
HAL_LPTIM_TimeOut_Start_IT(&hlptim1, LPTIM1_PERIOD, LPTIM1_TIMEOUT);
LPTIM1-> CR |= 0x00000003; // Enable and software trigger LPTIM1 in single-shot mode
But the counter keeps going and going as in continuous mode, same behavior. Am I doing something wrong?? I tried both with TimeOut_Start_IT and Counter_Start_IT and the behavior is the same.
