avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Sleep modes


From: 451707
Subject: [avr-gcc-list] Sleep modes
Date: Mon, 14 Jun 2004 18:19:36 +0200
User-agent: Internet Messaging Program (IMP) 3.1

Hello, 
I am working with an ATMEL ATMega8, at this moment I wait for a Timer0 Interrupt
in a busy wait but I have to use a sleep mode. I suppose the best mode is the
idle mode but I dont know how to put the processor in this mode. How to executed
the Sleep instruction?
My code is the following :


SIGNAL(SIG_OVERFLOW0){
        static int i=0;
        int a=h*7.2; 

        i++;
        if (i==a){
                bit=true;
                i=0;
        }
}
///////////////////////////////////
void main (){
while(!bit) { 
        ; //Busy wait 
 }
bit = false;

//The rest of the program 

}

I want to remove this busy wait entering one sleep mode. 
Thanks 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]