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
Posted: Thu Jan 30, 2003 1:42 am
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
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