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

Search found 8 matches
CCS Forum Index
Author Message
  Topic: CPU reset after wake from sleep
Static

Replies: 20
Views: 18388

PostForum: 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

PostForum: 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

PostForum: 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

PostForum: 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

PostForum: 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

PostForum: 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

PostForum: 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

PostForum: 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 ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group