Author |
Message |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Wed Apr 04, 2007 8:33 am Subject: CPU reset after wake from sleep |
Just so I understand, there's no way for me to save the state of a one bit variable (or 8 bit) when using sleep()? |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Wed Apr 04, 2007 6:48 am Subject: CPU reset after wake from sleep |
Is there anyway to save variable data after sleep?
For example, having a variable (like a counter) that gets updated once every push of a button, and keep that variables value, even after sleep o ... |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Wed Apr 04, 2007 6:15 am Subject: CPU reset after wake from sleep |
Yes, I'm purposely writing over the OSCCAL to set bit 0 (FOSC4) to 0. Would it be better to use the #bit instead?
For example:
#bit FOSC4 = 0x05.0
...
FOSC4 = 0;
I'm unsure which one to us ... |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Tue Apr 03, 2007 3:50 pm Subject: CPU reset after wake from sleep |
It works! Thanks for the help! |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Tue Apr 03, 2007 3:40 pm Subject: CPU reset after wake from sleep |
I think I understand. Are you telling me that the code for checking the status has to be before the sleep?
Example:
while(1)
{
y=restart_cause();
GPWUF = bit_test& ... |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Tue Apr 03, 2007 3:24 pm Subject: CPU reset after wake from sleep |
I'm running it on the chip not a simulator. |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Tue Apr 03, 2007 3:17 pm Subject: CPU reset after wake from sleep |
I attempted to find the cause of reset using the reset_cause() using the following:
y=restart_cause();
for(x=0;x<8;++x)
{
output_bit(PIN_B0,shift_right( ... |
Topic: CPU reset after wake from sleep |
Static
Replies: 20
Views: 18388
|
Forum: General CCS C Discussion Posted: Tue Apr 03, 2007 3:00 pm Subject: CPU reset after wake from sleep |
I'm using a 10F200 and attempting to use the sleep and wake on change. However, everytime the chip wakes up from a "wake-on-change" it does a reset and starts from the beginning of code ins ... |
|