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

Wake from sleep on CAN activity

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



Joined: 24 Sep 2009
Posts: 3

View user's profile Send private message

Wake from sleep on CAN activity
PostPosted: Thu Sep 24, 2009 7:13 am     Reply with quote

I wish send a 18F258 to sleep and get it to wake on any CAN activity sleep is fine but it will not wake. I see that there is an interrupt available to do this but it's not working. Am I missing a reg change other than the int setting as testing on the external interrupt works. thanks for any advice.
Ttelmah
Guest







PostPosted: Thu Sep 24, 2009 9:18 am     Reply with quote

Read the data sheet.
Look at the section on sleep.
Look at the paragraph 'wake up from sleep'. What does it say after the list of what devices _can_ wake you from sleep?.

Best Wishes
simonrash



Joined: 24 Sep 2009
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 24, 2009 9:58 am     Reply with quote

Thanks for the pointer. I got stuck on the data sheet section reading about the CAN module interrupts that says this will wake the device from sleep but as it does not look to be working I guess that's incorrect information. any other pointer if this is not the case would be great. Thanks
Ttelmah
Guest







PostPosted: Thu Sep 24, 2009 3:07 pm     Reply with quote

OK.
The key is understanding sleep.

The simpler processors have a single 'sleep' mode. The more complex ones, have 'low power' modes available, which don't put everything to sleep. CAN itself only works, provided you maintain a clock to the CAN module.

What you can do, is if your bus is _idle_, you can switch the CAN module to disabled mode, enable INT_CANWAKE, disable all other interrupts, and INT_GLOBAL, then put the chip to sleep. It will wake up on CAN bus activity (but not receive anything). You then have to enable the CAN module again, and can start to listen to the bus.
Obviously the other device(s) on the bus, need to know that they can't send actual data, till a significant time after waking the chip (typically about a 1000 clock cycles is required for the oscillator to start up, and you then have to allow time for the module to be reprogrammed as well.

This may do what you want?.

Best Wishes
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