Hello,
I have been trying to put the MPC5748g into standby mode and trying to wake up using my CAN rx line as a wake up event. But I am getting a reset on the wakeup event. I even do have a external SBC(watchdog on the board). But this is put into stop mode before going into standby mode. I wont see any reset when it is in STANDBY mode. But the moment it wakes up.. I can see the reset pin toogle. Below is my code for going into STANDBY mode. How to wake up without any reset and resume my code.
void MODE_INIT(void)
{
T_UBYTE lub_i;
/* Set ADC structure to Pointer */
volatile struct ADC_tag* lp_ADC;
/* switch off the watchdog */
EnableDisableWatchdog (FALSE);
/* Mode enable register ME_ME STANDBY0 */
MC_ME.ME.R = 0x00002000;
/* STOP0 Mode Configuration Register (ME_STOP0_MC ) *******************************************/
/* PD0 = 1 DFLASHON=01(Power_Down) CFLASHON=01(Power_Down) FMPLLON=0(off) FXOSCON=0(off) FIRCON=1(off) SYSCLK=0 */
MC_ME.STANDBY_MC.R = 0x0085000F;
/* In this case all peripherals are switched off */
for (lub_i=0;lub_i==67;lub_i++)
{
MC_ME.PCTL[lub_i].R = 0;
}
for (lub_i=70;lub_i==104;lub_i++)
{
MC_ME.PCTL[lub_i].R = 0;
}
/* Switch off adc*/
lp_ADC = &ADC_0;
lp_ADC->MCR.B.PWDN = 1 ;
lp_ADC = &ADC_1;
lp_ADC->MCR.B.PWDN = 1 ;
/* start in STANSBY0 mode µc ***************************************/
Mode_Manager(STANDBY0);
}
T_UBYTE Mode_Manager(T_UBYTE lub_Mode)
{
T_ULONG lul_Key1,lul_Key2,lul_timeout;
lul_timeout = TIMEOUT ;
/*Build ModeChange Keys*/
lul_Key1= ((uint32_t)lub_Mode<<28)+ ME_MCTL_KEY;
lul_Key2= ((uint32_t)lub_Mode<<28)+(~ME_MCTL_KEY&0x0000FFFF);
/*Start mode change*/
MC_ME.MCTL.R = lul_Key1; /* Mode & Key */
waitfor_low_power(200);
MC_ME.MCTL.R = lul_Key2; /* Mode & Key */
waitfor_low_power(200);
while ((MC_ME.IS.B.I_MTC != 1) && (lul_timeout) ) lul_timeout --; /* Lock code execution there till mode exit */
MC_ME.IS.B.I_MTC = 1; /* Clear bit */
/* Error timeout transmit */
if (!lul_timeout) return FALSE;
return TRUE;
}
Hi,
Reset is correct behavior on STANDY exit as you can read in reference manual:
Additionally:
The normal exit of the STANDBY0 mode is from a wakeup event. Interrupt events will not cause STANDBY0 mode exit.
The exit sequence of this mode is similar to the reset sequence, and the resets to all but power domain #0 are asserted with timing that is the same as reset PHASE1 through PHASE3. However, in addition to booting from the default location, the chip can also be configured to boot from the backup RAM. In the case of booting from backup RAM , it is also possible to keep the flashes disabled by writing “01” to the FLAON fields in th ME_DRUN_MC register prior to STANDBY0 entry.
If there is a STANDBY0 mode request while any wakeup event is active, the chip mode
does not change.
Peter
Hi ,
According to my understanding, the following diagram means that standby mode can wake up from system reset or a wakeup event.Or wake up from a wakeup event will result in a reset too?