A N 7 2 5
12
Rev. 0.1
5.2.2. Configuring a Device for Normal (PM0) and Power Mode 4
In Normal (PM0) and Power Mode 4, the device executes code from flash. The only difference between PM0 and
PM4 is the core clock speed (fast and slow, respectively).
To configure a device to run in PM0 or PM4:
1. Enable the clocks to peripherals that will be configured by firmware.
2. Select the desired clock source (LPOSC0, PLL0, etc.) and speed for both AHB and APB clocks.
3. Select the desired adaptive voltage scaling settings using the LDO module.
4. (Optional) Disable the retention mode of any enabled RAM banks.
5. Set the pins in the lowest power configuration for this mode.
6. Disable all unused peripherals.
7. Disable the clocks to all unused peripherals.
8. Jump to code in flash.
To measure the data sheet numbers using an SiM3L1xx MCU Card and the AN725_PowerModes_0_and_4
example:
1. Configure the SiM3L1xx MCU Card according to the instructions in “5.2.1. Hardware Setup”.
2. Open the AN725_PowerModes_0_and_4 example in either Keil µVision or the Precision32 IDE.
3. Select the desired settings using the #defines at the top of the file. There is a set of defines for each data
sheet specification.
4. Compile and download the code to the device.
5. Disconnect the USB Debug Adapter.
6. Reset the device.
7. Measure the power consumption of the device.
5.2.3. Configuring a Device for Power Modes 1 and 5
In Power Modes 1 and 5, the device executes code from RAM rather than flash. The only difference between PM1
and PM5 is the core clock speed (fast and slow, respectively).
Keil µVision uses a scatterfile with a retention RAM tag defined as MCU_RAM_CODE:
MC0 {
.ANY (+RW +ZI)
.ANY (MCU_RAM_CODE)
}
The project source file can then define a tag in code to place functions in this section of memory:
#define __SI32_RRAM __attribute__ ((section("MCU_RAM_CODE")))
Any functions that use the __SI32_RRAM tag in the definition will be placed in RAM starting at 0x2000_0000:
__SI32_RRAM void run_PM1(void)
{
...
}
For Precision32 projects, a function can be located in RAM by treating it like normal data and applying a data