How does the MPC5746C change power mode from STANDBY to DRUN?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does the MPC5746C change power mode from STANDBY to DRUN?

588 Views
1622542013
Contributor II

Because my project can not avoid these things as follows:

BLOCK_reason.png

My project always go fail into standby and then the API <POWER_SYS_SetMode> returns status.

<Dinit all the peripheral >;

<Set wakeup address and wakeup source >;

stSwitchMode = POWER_SYS_SetMode(standby_mode, POWER_MANAGER_POLICY_AGREEMENT);

if(stSwitchMode == STATUS_SUCCESS)

{

   <do something to resume the program>

}

else

{

   mcu_reset();

}

However there are two questions.

1. The program has a certain probability to be blocked in there:MC_ME_changemode.png

2. The program has a certain probability not blocked but all the peripheral do not work。

It is not useful to init again the clock and the powermode.

when  <POWER_SYS_SetMode> returns STATUS_SUCCES :

(void)CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
(void)POWER_SYS_SetMode(drun_mode, POWER_MANAGER_POLICY_AGREEMENT);

<Init all the peripheral >;

But all the peripheral do not work and the mcu can not go into standby.

There are two situation that the program do not block and occur error.

1. 

stSwitchMode = POWER_SYS_SetMode(standby_mode, POWER_MANAGER_POLICY_AGREEMENT);

if(stSwitchMode == STATUS_SUCCESS)

{

   mcu_reset();

}

else

{

   mcu_reset();

}

2.enable the watch dog.

How can i do to resume the program from standby fail to drun and go into standby once again?

Tags (1)
0 Kudos
1 Reply

446 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

How can i do to resume the program from standby fail to drun and go into standby once again?

If you ask for mode transition and it fails you will be still in the mode from you have asked transition. If that was DRUN you will be in DRUN. If that was any other mode you will have to as fro DRUN transition.

You just simply ask for another mode transition once you have prepared micro to enter standby mode.

I am not sure what youare trying to achieve or which SW do you use.

But have a look at example code demonstrating Standby transition:

Example MPC5748G Standby mode GHS614 

Also in case you want to go into standby mode you have to follow certain steps:

Summary of register configurations before entering STANDBY mode:

1. Configure CMP_x_C2[RRE] and RTC_RTCC[TRIG_EN] to enable round robin function during standby.
2. Enable the round robin interrupt by configuring RRIE in CMP_x_C2.
3. Enable the DAC to be used as the reference voltage on either plus or minus of the
      mux inside CMP.
4. Configure the NSAM field of the CMP_x_C2 register(s) to select the number of
      clock cycles for which a channel is selected for sampling.
5. Set ACOn for the predefined values of the state of the 8 bits corresponding to the
      eight inputs.
6. Configure RTC_APIVAL to set the period of the round robin operation.
7. Configure RTC_ANLCMP_CNT as the initialization time of the CMP module.

NOTE
This RTC API - CMP interaction for wakeup feature is available in STOP, LPU_STOP, STANDBY and LPU_STANDBY modes.

regards,

Peter

0 Kudos