English
Language : 

AN3316 Datasheet, PDF (23/42 Pages) STMicroelectronics – SPC560B power and mode management
AN3316
Device modes
6. Request transition to RUN0 mode:
The transition from a mode to another is handled by software by accessing the mode
control ME_MCTL register twice by writing:
– the first time with the value of the key (0x5AF0) into the KEY bit field and the
required target mode into the TARGET_MODE bit field
– the second time with the inverted value of the key (0xA50F) into the KEY bit field
and the required target mode into the TARGET_MODE bit field.
So, in case of DRUN RUN0 transition, these two register writing should be done:
ME.MCTL.R = 0x40005AF0
ME.MCTL.R = 0x4000A50F
7. DRUN RUN0 mode:
Once a valid mode transition request is detected, the transition starts. Here, device
switches-on/off modules and peripherals without CPU intervention.
It is possible to check for transition completion through mode Transition Status bit:
While (ME.GS.MTRANS != 0) //transition ongoing
... //transition completed
...
In ordeI to prevent code stucking waiting for transition completion, it could be better to
check transition timing through a timer. Timer timeout calculation should be based on
modules/peripherals start-up timing. In this case this value is close to XTAL start-up
time (at maximum 6 msec).
8. RUN0 mode:
Otherwise, if transition completion is signaled by sw, the RUN0 is properly entered with
the modules configured as expected.
Scenario 2 (RUN0  HALT  RUN0)
This scenario deals with HALT mode that is the only one allowing to reduce average
consumption while the application is 100% functional. In fact, reducing dynamic
consumption through core switching-off and togheter with maintaining the full functionality is
one of the new challenge in body.
Figure 12. Scenario 2 - finite state machine
Software triggered transition
RUN0
HALT
Hardware triggered transition
XTAL, PLL = ON
sysclk = PLL-64MHz
CFLASH = ON
DFLASH = Low Power
SPI0, ADC0 = ON
XTAL, PLL = ON
sysclk = PLL-64MHz
CFLASH = Low Power
DFLASH = Low Power
SPI0, ADC0 = ON
CAN0 = ON
Doc ID 18232 Rev 2
23/42