CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

unable wake up from sleep by external interrupt

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
YASU



Joined: 18 Mar 2010
Posts: 7

View user's profile Send private message

unable wake up from sleep by external interrupt
PostPosted: Thu Mar 25, 2010 12:29 pm     Reply with quote

Now I have some program about waking up from sleep mode.

It seems to be remained under sleep mode and could not wake up from sleep correctly.

On the debugger, under sleep mode, by interrupt program will start again.
But after woke up from
sleep();
the program return to beginning of main()
not restarting from the next of sleep();

On the Flash program,
No interrupt seems to be occurred and program remain in sleep mode.

I don't know the difference between debugger and flash.
And I would like to know how to wake up from sleep correctly.


Device : PIC16LF1937
MPLAB version : 8.46
PCM version : 4.104

And code is as following.
Code:

      if(Status == FALSE )
      {
         disable_interrupts( INT_TIMER0 );
         enable_interrupts( INT_RB0 );
         enable_interrupts( INT_RB1 );
         enable_interrupts( INT_RB2 );
         enable_interrupts( INT_RB5 );
         enable_interrupts( INT_RB6 );
         enable_interrupts( INT_RB7 );

         sleep();
         
         disable_interrupts( INT_RB0 );
         disable_interrupts( INT_RB1 );
         disable_interrupts( INT_RB2 );
         disable_interrupts( INT_RB5 );
         disable_interrupts( INT_RB6 );
         disable_interrupts( INT_RB7 );
         enable_interrupts( INT_TIMER0 );
      }
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group