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 support@ccsinfo.com

18F452 wake up from SLEEP

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







18F452 wake up from SLEEP
PostPosted: Wed Jan 29, 2003 6:37 pm     Reply with quote

Does any one know why I can't wake up the 18F452 from sleep with the RDA_isr interrupt???
___________________________
This message was ported from CCS's old forum
Original Post ID: 11122
Tomi
Guest







Re: 18F452 wake up from SLEEP
PostPosted: Thu Jan 30, 2003 1:42 am     Reply with quote

Because the CPU clock is stopped under sleep. So the baud rate generator is also stopped.
If you want to use sleep and serial comm then tie the receive line to a bit of port_B.4-7 and use port_b change interrupt to wake up the PIC:
#int_RB
void __INTRB()
{
char inp;
inp = port_B; // read port_b
tosleep = 1; // give a small time
disable_interrupts(INT_RB); // disable further RB ITs
}

And before sleep in the main():

if (!tosleep) {
enable_interrupts(INT_EXT);
enable_interrupts(INT_TIMER1);
enable_interrupts(INT_RDA);
enable_interrupts(INT_RB); // re-enable RB IT
enable_interrupts(GLOBAL);
restart_wdt();
Sleep();
#asm
NOP
#endasm
}



:=Does any one know why I can't wake up the 18F452 from sleep with the RDA_isr interrupt???
___________________________
This message was ported from CCS's old forum
Original Post ID: 11129
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