YASU
Joined: 18 Mar 2010 Posts: 7
|
unable wake up from sleep by external interrupt |
Posted: Thu Mar 25, 2010 12:29 pm |
|
|
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 );
} |
|
|