Skip to content

Commit 59d306f

Browse files
added results from PPK2
1 parent d7cd717 commit 59d306f

8 files changed

+27
-5
lines changed

docs/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11

22
## Measurements
3-
Here's an overview of the reduction in power usage that you can expect from this library:
3+
Here's an overview of the reduction in power usage that you can expect from this library. The screenshots below are taken from the nRF Power Profiler application using a Nordic PPK2 while running the blink sketch on the same board.
4+
5+
#### Normal operating conditions
6+
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/normal_usage_blink.png)
7+
48
#### Sleep Mode with peripherals off
9+
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_no_peripherals.png)
10+
511
#### Deep Sleep Mode with peripherals off
6-
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_no_peripherals.jpeg)
12+
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_no_peripherals.png)
13+
14+
715
#### Sleep Mode with peripherals on
16+
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_peripherals_on.png)
17+
818
#### Deep Sleep Mode with peripherals on
19+
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_peripherals_on.png)
920

1021
## Usage
1122
### Selecting a wakeup source
-181 KB
Binary file not shown.
444 KB
Loading
453 KB
Loading

extras/results/normal_usage_blink.png

309 KB
Loading
184 KB
Loading
416 KB
Loading

src/Arduino_Portenta_C33_LowPower.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,33 @@ LowPower::LowPower(){
66
RenesasLowPowerConfig.output_port_enable = LPM_OUTPUT_PORT_ENABLE_HIGH_IMPEDANCE;
77
RenesasLowPowerConfig.io_port_state = LPM_IO_PORT_RESET;
88
RenesasLowPowerConfig.low_power_mode = LPM_MODE_DEEP;
9-
R_LPM_Open(&RenesasLowPowerControlBlock, &RenesasLowPowerConfig);
9+
RenesasLowPowerConfig.standby_wake_sources = LPM_STANDBY_WAKE_SOURCE_IRQ15;
10+
RenesasLowPowerConfig.deep_standby_cancel_source = LPM_DEEP_STANDBY_CANCEL_SOURCE_IRQ15;
11+
1012
}
1113

1214
void LowPower::sleep(){
1315
RenesasLowPowerConfig.low_power_mode = LPM_MODE_STANDBY;
16+
R_LPM_Open(&RenesasLowPowerControlBlock, &RenesasLowPowerConfig);
1417
R_LPM_LowPowerModeEnter(&RenesasLowPowerControlBlock);
1518
}
1619

1720
void LowPower::deepSleep(){
1821
RenesasLowPowerConfig.low_power_mode = LPM_MODE_DEEP;
22+
R_LPM_Open(&RenesasLowPowerControlBlock, &RenesasLowPowerConfig);
1923
R_LPM_LowPowerModeEnter(&RenesasLowPowerControlBlock);
2024
}
2125

2226
void LowPower::enableWakeupFromRTC(){
23-
RenesasLowPowerConfig.deep_standby_cancel_source = LPM_DEEP_STANDBY_CANCEL_SOURCE_RTC_ALARM;
24-
RenesasLowPowerConfig.standby_wake_sources = LPM_STANDBY_WAKE_SOURCE_RTCALM;
27+
if(deepSleepWakeupSource == 0)
28+
deepSleepWakeupSource = LPM_DEEP_STANDBY_CANCEL_SOURCE_RTC_ALARM;
29+
else
30+
deepSleepWakeupSource = deepSleepWakeupSource | LPM_DEEP_STANDBY_CANCEL_SOURCE_RTC_ALARM;
31+
32+
if(standbyWakeupSource == 0)
33+
standbyWakeupSource = LPM_STANDBY_WAKE_SOURCE_RTCALM;
34+
else
35+
standbyWakeupSource = standbyWakeupSource | LPM_STANDBY_WAKE_SOURCE_RTCALM;
2536
}
2637

2738
bool LowPower::enableWakeupFromPin(uint8_t pin, PinStatus direction){

0 commit comments

Comments
 (0)