Jump to content
Badejavu

Help!boost C "sleep();" Not Working For Pic18Lf26K80

Recommended Posts

When I call the sleep function in boost C, using mplab IDE, the PIC does not go to sleep.I have tried inline assembly as well and still the PIC does not sleep.I observed the current consumption when the sleep function is called and still no current drop. I also included the "boosts.h" and it still does not work.

Has anyone used the sleep routine and it worked? Or is this problem PIC related?

 

Thanks

Badejo

Share this post


Link to post
Share on other sites

Hi

 

Are you sure the PIC is not going to sleep, or is it being waken up by the watchdog or some other peripheral.

This might hapen so fast that you can see the current drop with a standard ameter.

 

 

Best regards

Jorge

Share this post


Link to post
Share on other sites

Hi Badejo,

 

Are you operating a secondary clock system to save power when asleep.

 

If so sleep will not occur if certain timers are not enabled correctly.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

I am not using a secondary clock.The PIC uses the internal oscillator. The PIC can only wake up to a portb 0 interrupt, but this is not the case.It just never goes to sleep, and there are no codes after the sleep instruction this way i can detect a current drop on the ammeter…Could it be because I am using the internal oscillator?

Thanks

Badejo

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×