Hi,
I am trying to reach low power consumption on Nano 33 BLE board.
I noticed a huge power consumption gap in the delay() function for the same code between version of board manager.
If I choose Arduino Mbed OS Nano Board V4.1.3, I have a bigger power consumption than with [DEPRECATED - Please install standalone package] Arduino Mbed OS Boards V1.1.3
How could I find the difference between both board manager version and correct the lastest one ?
I tried only to go in deepsleep mode (with NRF_POWER->SYSTEMOFF=1) but I need external wakeup signal and RAM is OFF.
What are the other alternatives to delay() function?
I look deeper into version of board manager and the power consumption gap is between [DEPRECATED - Please install standalone package] Arduino Mbed OS Boards V1.3.2 and V2.0.0.
As you have not provided any details or the circumstances in which you are using it I cannot say for certain, but it might be worth looking at the use of the millis() function as demonstrated in the BlinkWithoutDelay example
I didn't test the function millis() but it will.
Update : millis() function is used for another purpose : be able to do something during the waiting time. I looking to do nothing during a given period of time with the less power consumption but with the RAM still ON.
I understood that delay() function manage to put the MCU in sleep mode but obviously something change between version of board manager.
I am very doubtful whether the delay() function ever put the processor into sleep mode
The millis() function simply returns the number of milliseconds elapsed since the processor was last powered up or reset. What you do with that value, including creating you own "delay" function is up to you
As a matter of interest, how long are the delays that you are using ?
I am trying to monitor sensor value every 20s and try to keep the power consumption as low as possible during those 20s.
Without delay() function my current consumption is around 3mA (so MCU still running)
With delay() function my current consumption is between 200 and 400µA depending of the version of board manager (MCU is in sleep mode and I have some current consumption from other parts).
It is frustrating when full details are not given of a problem. For instance, if you had said in your first post that you were following the advice in the page linked to then the problem would have been in context
I assume that you have followed all of the advice on that page
That why my question was focus of the power consumption delta of the delay() function according to the version of board manager. I am happy with the power consumption of the delay() function with the old deprecated version of board manager but some functionnalities I am looking to use are not supported.