Hi NXP team,
I'm using RD9Z1-638 to develop BMS project.There is a demand that device can be woke up from stop mode by current threshold or Ah counter.
This is my code:
u8 CAN_status[3];
Sleep_CAN(CAN0, CMPTX); // request CAN channel 0 go to sleep with completing transmission scheduled
do {
Check_CAN_Status(CAN0, CAN_status); // read the channel 0 status
} while (!(CAN_status[1] & SLPAK)); // wait till SLPAK bit set
B_PCR_WUEH_WUPTB4 = 1; // enable PTB4 wakeup
B_ACQ_CTH = 100;
B_PCR_WUEH_WUAHTH = 1; //Wake-up on Ah counter enabled
B_GPIO_TSENSE = 0;
B_GPIO_VSENSE = 0;
ADCDisable();
TsenseDisable();
CAN_STDBY(STANDBYMODE);
ApiRtcSetWakeupPeriod(RTC_PERIOD_WAKE_TIME);
PCREnterStopMode();
......
but it didn't work.
I'd like to know if there is sample code for this function!
Thanks!