Dear Sir,
When debugging the Ampere timing wake-up feature, I encountered an issue. The actual testing scenario here is constant discharge at 10mA with 100 sampling points per second. The wake-up threshold is set to 10000. However, the actual result is that the device takes approximately 20 seconds to wake up, which is exactly double the expected value. I have checked the PCR_CTL.PF registers, and their values are all 0. I would like to know what other configurations need to be checked.
code:
static void CurrentWakeupCfg(u32 current_ah_thres)
{
if (!current_ah_thres)
{
current_ah_thres = 100;
}
B_ACQ_TCMP = ADC_CURRENT_SAMPLE_PERIOD; //10 //measure every 10ms in sleep LP clock = 1KHz, depends on PF[1:0] setting
B_ACQ_CTH = (CURRENT_THRESHOLD_WAKEUP >> 1); // config to wakeup if |I| > 500mA
B_ACQ_THF = 0; //filtering
// config to wakeup if Ah counter >xxx
B_ACQ_CTL = B_ACQ_CTL_AHCRM_MASK | B_ACQ_CTL_AHCR_MASK; // reset Ah counter
B_ACQ_AHTH = current_ah_thres; // 10mA * 10s * 100S/s
ADCLpEnable();
B_PCR_WUEH_WUAHTH = 1; //Wake-up on Ah counter enabled
B_PCR_WUEH_WUCTH = 1; //Wake-up on current threshold Flag
}
Please see the waveform:

Thanks!