Sleep mode

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Sleep mode

Post by mebab »

I read a sensor every 10 ms by using an interrupt and do other stuff afterward with Arduino. I use the following while loop and fill-up an array while waiting inside the loop and exit the loop as soon as the array gets full.
I would like to keep a Nucleo L476 to do the same task with the minimum consumption power.

Code: Select all

    do
    {
      delay(1);
    }  while (arrayisfull == 0); // Wait loop
 
This loop takes a few seconds to be terminated. Is the sleep mode efficient in such cases? How to apply that here?

Many thanks for your guidance!
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Sleep mode

Post by stevestrong »

mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: Sleep mode

Post by mebab »

Thank you so much!
I implemented sleep mode and work further around this loop-case to find a better solution with less sleep-wake up procedure. With 1 ms sleep time, it has to sleep and wake up ten times during each 10ms interrupt time. I increased sleep time to 10 ms instead of 1 ms to get better performance.
Since the loop time varies and runs up to 10 seconds, is there any other way to get the lowest possible power consumption during this loop time?
Post Reply

Return to “IDE's”