[En-Nut-Discussion] Using Power Save Modes with Ethernut + Thread/Timer-Management

Matthias Dyer dyer at tik.ee.ethz.ch
Tue Oct 5 15:09:04 CEST 2004


Hallo,

I'd like to explore power-saving techniques on a ethernut powered 
Atmega128L. In particular, i want to send the uC into an apropriate 
sleep mode if its idle (e.g. when idle thread is running).

Now my question is: What happens with the timerinfo sturcture of a 
sleeping thread if the uC goes to a power saving mode and wakes up later?

Consider following example:

THREAD(t_blink, arg){
   for(;;){
     led_on();
     NutSleep(5000); // 5s
     led_off();
     NutSleep(5000);
   }
}

I can now intercept the sleep function call and write an own idle 
thread, that calculates the duration of the idle period. With this I can 
set up an external timer to wake up the uC that I send into a sleep mode.

The timer that handles the threads ready/sleeping state is a software 
timer, right? So it will not be updated, when the uC is sleeping.

For this purpose do I really have to rewrite the thread ready/sleeping 
state handling with an own external timer?

Any ideas?

Thanks,
Matthias


-- 
-------------------------------------------------------------
Matthias Dyer                    phone: +41-1-6327061
Gloriastr. 35, ETZ G-75,         fax:   +41-1-6321035
CH-8092 Zurich, Switzerland      email: dyer at tik.ee.ethz.ch

Computer Engineering and Networks Lab (TIK)
Swiss Federal Institute of Technology (ETH) Zuerich
-------------------------------------------------------------



More information about the En-Nut-Discussion mailing list