From 2fa3aaa1617849dd29fe55c844d5250df0cba955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 7 May 2023 18:15:33 +0200 Subject: [PATCH] Power optimization - enable the DC/DC regulator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DC/DC regulator reduce the power consumption of the MCU compared to the default LDO regulator. The DC/DC regulator needs additional HW that is mounted on the PineTime. This change reduces the power usage by 380µA during fast advertising, by 200µA during slow advertising and by 186µA when BLE is disabled. --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index aa98de3f..9c13a169 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -304,7 +304,12 @@ void calibrate_lf_clock_rc(nrf_drv_clock_evt_type_t /*event*/) { nrf_drv_clock_calibration_start(16, calibrate_lf_clock_rc); } +void enable_dcdc_regulator() { + NRF_POWER->DCDCEN = 1; +} + int main() { + enable_dcdc_regulator(); logger.Init(); nrf_drv_clock_init();