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

Harald Kipp harald.kipp at egnite.de
Tue Oct 5 18:02:14 CEST 2004


Matthias,

Ethernut uses the 32 kHz timer oscillator, which is still
running in power save mode. This way it is possible to
get woken up every 62.5 ms without any external hardware
and check the timer queue.

(Page 44 of the ATmega128 datasheet)

Regards,

Harald

At 15:09 05.10.2004 +0200, you wrote:
>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




More information about the En-Nut-Discussion mailing list