Using USB with Sleep

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
RDHeiliger
Registered User
Registered User
Posts: 26
Joined: Sun Oct 12, 2008 11:21 pm
Location: Utah

Using USB with Sleep

Post by RDHeiliger » Thu Mar 12, 2009 5:39 pm

I am attempting to use USB in a battery powered logger. The USB is not normally connected. USB is used only to upload data. I use Tmr1 with an external 32KHz Xtal for a 1 second time base for a Real Time Clock. The PIC18F2550 remains in SLEEP for the entire one second. On waking up on the Tmr1 interrupt the logging functions are run.

I have the USB and Tmr1 and logging all working. But when the USB cable is attached after SLEEP the logger is no longer recognized by the master on the PC. It appears that I must put the USB into suspend mode before issuing the sleep instruction. Then re-initialize the USB when coming out of sleep to see if the USB cable has been reattached.

Has any one done something like this or can point me in a helpful direction.

RD

Post Reply