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

Problem with interrupts and USB communication - 18F4550

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



Joined: 01 Nov 2008
Posts: 1

View user's profile Send private message

Problem with interrupts and USB communication - 18F4550
PostPosted: Sat Nov 01, 2008 5:46 pm     Reply with quote

I have 2 uses for the microcontroller. Analog-to-digital conversion and driving servomotors with PWM. For the PWM I am using a code with interrupts. However, with those interrupts enabled (RTCC or timer0), the PIC cannot communicate through USB. I get a "device not recognized" error every time. Without USB communication I can't see my ADC results. How do I get around this, or what am I doing wrong?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 02, 2008 12:27 am     Reply with quote

Turn on the compiler warning messages (if they are turned off) and
re-compile. Are you getting any warnings ?
Bcox



Joined: 09 Oct 2007
Posts: 17
Location: Windsor, CT

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

PostPosted: Mon Nov 03, 2008 9:18 am     Reply with quote

i am using an 18F4550 for several very similar applications. I ran into the same problem that you were having. Here was my problem and solution.

Problem: An external trigger (interrupt) would tell the pic to turn on or off the PWM of a solenoid. If this trigger was pulsing prior to me plugging in the USB, I would get the same "device not recognized" error. What was happening was that the external interrupt was not allowing the USB finish establishing a connection with the PC. In my case, I need the external interrupt to be the highest priority. The USB communication is not needed as the device will mostly be running not connected to a PC.

Solution: Make sure no interrupts occur while attempting to connect to the computer. In my case, connect the device to the PC before sending an external trigger.

Hope this helps!
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