TSC measurement after exiting STOP mode (Abnormal delta)
Hi,
MCU: STM32L072
MCU is using TSC and ST touch sense library.
When there is no stop mode involved, the measurement delta of no pressing is normal (-1, 0, 1).
If MCU enters stop mode and then exits stop mode for touch sensing measurement, the delta would be much higher (6, 7).
However, the delta would become normal again in following situation.
- Wait up from STOP mode and the wait about 200ms to start TSC measurement.
- After exiting stop mode, keep MCU running without entering stop mode again, the delta would become normal after some period of time (MCU would keep measuring touch sensing every 500ms).
The clock setting should be the same because program would call SystemClock_Config() after exiting stop mode.
void EnterStopMode(void)
{
// Enable Ultra low power mode
HAL_PWREx_EnableUltraLowPower();
// Disable the fast wake up from Ultra low power mode
HAL_PWREx_DisableFastWakeUp();
// Select HSI as system clock source after Wake Up from Stop mode
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
// In Stop mode
// Wake up
HAL_ResumeTick();
SystemClock_Config();
}I would like to know why the TSC measurement need to wait a period of time after exiting stop mode in order to get normal reading.
