Hello.
I'm developing small BMS with MM9Z1-638 processor.
I implemented low power state by using 'STOP' mode (wakes up by LIN only) and it has no problem so far.
However, there need to be dropping down sleep current lower than 100uA, I'm considering about 'SLEEP' mode.
Transition from standby state to sleep state has no problem.
But when I'm trying to wake up the 638ic by triggering with LIN, analog die sends reset signal repeatedly.

Our reference says "The microcontroller has to acknowledge the Normal mode, by writing the OPM=00, to allow a controlled transition into the D2D Clock domain. If the clock domain transition is not required, the microcontroller may issue a Sleep / Stop mode entry instead"
Here is my code.
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
void Go_to_Sleep(void)
{
uint8_t u8Ret;
// disable interrupts (SCI and TIM are read only in Intermediate mode!!!! So any pending IRQ might trigger multiple D2Dinterrupts)
//! \todo how to disable with lin driver and SCI!!! Stop Timer or disable just ch3
write_eep_total_aging(NEEP_ALL);
ADCDisable();
//TsenseDisable();
B_ACQ_CTL = 0; //TsenseDisable
B_GPIO_VSENSE = 0;
// LIN Timer Disable
B_TSCR1_TEN = 0;
B_TIE_C3I = 0;
lin_timeout_counter=0;
// Enable LIN wakeup source(works independent of LIN PHY enable)
B_PCR_WUE_WULIN=1;
PCREnterSleepMode(); // 65uA reset analog die ?????.
// .....zzzzzzzzzzz (stop mode)
// after wakeup the code continues to run here....
// but first the D2D Interrupt service routine will be run
////////////////////// ???? Wake up ???? //////////////////////
B_WD_CTL = 0x0700; //watch dog off
B_PCR_CTL = OPM_SET_NORMAL; /* set normal mode*/
// Re-enable
B_TSCR1_TEN = 1;
B_TIE_C3I = 1;
u8Ret = l_ifc_init(LI0); // is this how it should be?
D2DInit(1); // 25 MHz MCU freq, 25 MHz D2D freq. (no divider)
SYS_Analog_Init();
ADC_Init();
VsenseInit();
CsenseInit();
TsenseInit();
}
void PCREnterSleepMode(void) {
//! \todo check what potions should be inside or outside this routine, e.g. IrQDisable()?
IrqDisable();
//! \todo check if this makes sense like this?
B_INT_MSK = 0xFF3F; // Mask Analog Interrupts
B_ACQ_SRH = 0xFF; // Clear pending Flags
B_INT_MSK = 0xFF00; // Enable Analog Int
IrqEnable();
B_PCR_SR = 0xFFFF; // Clear Flags
B_PCR_CTL = OPM_SET_SLEEP; // Goto Sleep Mode
StopEnable();
StopEnter();
}
Thank you for considering my problem.
Best regards,
Lim