Hi Manish,
The generated heat is proportional to consumed power (consumed current).
From this point of view is definitely better to use STOP mode (~100uA) instead WAIT mode (~40mA).
The Wait mode just stops core and wait for an interrupt. The Stop mode stops (almost) all clocks.
Note: The current consumed by MCU itself depends mainly on bus clock frequency. So, the third way how to decrease consumed current (generated heat) is a change of your clock settings.
However, since you use the internal voltage regulator, the STOP mode will not have any influence on heat produced by currents to external loads (pin voltage levels are unchanged during STOP mode).
Since you don’t use the external oscillator, the Pseudo STOP mode has no advantage for you.
Just for sure: I suppose for now that you don’t use CAN communication in your application. In opposite case, I definitely recommend using an external crystal as CAN module clock source. The internal oscillator isn’t enough accurate for CAN communication.
About wakeup time)
Here it depends on how the wake-up time is defined. I suppose that MCU is wake by one of the interrupts. In that case, the core will execute code in interrupt service routine and after that it will continue in main code (if there no other pending interrupts). Any entering and exiting to/from ISR need approximately 10 bus cycles for stacking,… Additionally, the clock module needs some time to stabilize it = until PLL lock.
How to enter into STOP mode)
As first, we have to clear S bit in CCR register to enable stop mode. For example:
asm ANDCC #0x7F; //clear S bit - enable the stop mode. If the S bit is not
//cleared then STOP instruction has no effect and is
//executed as a dummy instruction NOP.
The S bit is set again by next MCU reset
If we want to wake-up MCU by any I bit maskable interrupts, we have to enable interrupts = clear I bit. For example:
EnableInterrupts;
Finally, the entering into stop mode is caused by STOP instruction. For example:
asm STOP; //STOP mode
Please look at Table 1-16. Interrupt Vector Locations in RM for the check which interrupts may be used for wake-up from Wait/Stop mode.
Note: The floating inputs (digital input pins without any pull-up or pull-down) may cause increasing power consumption when they work in the linear area near to VDDX/2. So, I would like to recommend to keep all unused pins in some of the defined states = digital output/digital input with internal/external pull up/down.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------