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

ADC in sleep locking up

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



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

ADC in sleep locking up
PostPosted: Mon Nov 23, 2009 12:46 am     Reply with quote

I've already solved this, but thought I'd write about it in case it affected anyone else.

I implemented an ADC conversion during sleep, but the device (12F675) never woke up. Same thing with a 16F877A. It seemed the analog interrupt was not going off.

After several hours, I finally figured out the problem was that the Peripheral Interrupt Enable (PEIE) was not set. In fact, it wasn't being set anywhere.

It's probably a bug in the compiler (v4.095). I would have expected the peripheral interrupts to be enabled as a matter of course, or at least as part of enabling interrupts for a peripheral. In any case, once I manually enabled the PEIE myself, the analog conversion worked perfectly.
_________________
Andrew
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 23, 2009 1:07 am     Reply with quote

See this post regarding the PEIE bit:
http://www.ccsinfo.com/forum/viewtopic.php?t=28158&start=8
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 23, 2009 3:16 am     Reply with quote

Thanks. I like your idea of a new #define for enable/disable_interrupts().
_________________
Andrew
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