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

PIC18f4550 does not wake up from sleep

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



Joined: 21 Oct 2010
Posts: 85

View user's profile Send private message

PIC18f4550 does not wake up from sleep
PostPosted: Thu Sep 29, 2011 2:13 pm     Reply with quote

Hello,

My PIC is sleeping after the sleep() command. But I can't wake up the pic?

I have from the ex_wakeup.c this:
Code:

ext_int_edge(H_TO_L);
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);

On which pins will the pic wake up?

Anybody an Idea?

Best regards
Volker


Last edited by Prefekt on Sat Oct 01, 2011 5:54 am; edited 1 time in total
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 2:25 pm     Reply with quote

Look at section 3.3 in the datasheet titled SLEEP MODE and section 9.7 about interrupts.

Also, see Section 10.2 near the bottom of the first column.
_________________
Google and Forum Search are some of your best tools!!!!
Prefekt



Joined: 21 Oct 2010
Posts: 85

View user's profile Send private message

PostPosted: Sat Oct 01, 2011 5:59 am     Reply with quote

Hello,

the ex_wakeup works fine.

But I my appliction the pic does not wake up. I USB the USB connection from the ex_usb_serial.c example and enable INT_EXT and GLOBAL interrupts.
On the pin B0 is a push button from +5V and a pull down resistor...

Best regards
Volker
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Oct 01, 2011 6:21 am     Reply with quote

Post your CCS compiler version and a short, complete, compilable program that shows the problem.
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Sat Oct 01, 2011 3:02 pm     Reply with quote

Seriously, you can't do this.....
If your device is connected to a USB bus, then you can't just put it to sleep. Doing so, risks putting the USB bus into an unpredictable state. The USB controller itself, should only be put to sleep, when an IDLEIF is received from the USB host. Otherwise, you need to leave the USB component powered (you can sleep the CPU itself). A device connected to the USB bus, _must_ respond when the master talks to it. It you completely sleep the CPU, this won't happen....
You can use sleep(SLEEP_IDLE), to leave the USB components powered.

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