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

Problems with USB / 18F4550
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

Problems with USB / 18F4550
PostPosted: Fri Jun 26, 2009 12:34 pm     Reply with quote

Hi! I am using many examples and projects downloaded off internet, or examples of the CCS Compiler to comunicate between PIC / PC and never the PC recognized the PIC. On all projects and examples, when connect the USB cable, the messages show that the device is not recognized. I need help, because I read the datasheet, manuals, tutorials, and I can't make the PC recognize the PIC, on CDC examples and HID too.

I am using a 20MHz crystal, and the code to oscillator configuration is above:
Code:
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1, VREGEN
#use delay(clock=48000000)

I am using a 270nF capacitor in USB pin of the PIC, but I don't use the 5V power supply of the bus. I have an external supply, for it the +Vcc USB bus pin is connected with a 10k pin to ground.

A curious fact is which never, on none of the examples or projects, the windows requests some driver.. Some tests the windows install a generic driver, but with this driver the pic does not communicate with PC, or as serial emulator (cdc).

I need help!!!!! Thanks in advance!!! Sad Sad
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 26, 2009 12:44 pm     Reply with quote

In this post, I provide a "walk through" for the Hiddemo example.
It has tips to make the demo work with a 18F4550:
http://www.ccsinfo.com/forum/viewtopic.php?t=38897
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 26, 2009 1:08 pm     Reply with quote

I make the modifications presents on the post and nothing changed.
The windows install the generic driver, and shows the PIC in the hardware list as unknown device...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 26, 2009 1:23 pm     Reply with quote

What version of Windows ? I tested this on Win2K SP4.
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 26, 2009 1:43 pm     Reply with quote

the version is XP SP2...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 26, 2009 2:51 pm     Reply with quote

What is your compiler version ? It's a 4-digit number in this format: x.xxx
It's given at the top of the .LST file. The .LST file is in your project
directory (after a successful compile).
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 26, 2009 2:55 pm     Reply with quote

CCS PCH C Compiler, Version 4.068, 5937
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 26, 2009 3:05 pm     Reply with quote

I heard that some versions of the CCS have bugs in the oscillator configuration, but I dont know what is and which versions are.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 26, 2009 3:19 pm     Reply with quote

I did a file comparison on some of the USB files, such as
Quote:

pic18_usb.h
ex_usb_hid.c
usb_desc_hid.h

and there are many differences between vs. 4.068 and vs. 4.093.
(I didn't compare all the files in the project. I stopped looking after
seeing so many differences in just these 3 files).
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Mon Jun 29, 2009 8:06 am     Reply with quote

but if you found these differences are the origins of failure in using the USB communication?
Ttelmah
Guest







PostPosted: Mon Jun 29, 2009 9:59 am     Reply with quote

I doubt it.
I have USB code working OK, that was compiled with versions back around this area.

A couple of other comments apply.

270nF, is 'borderline'. CCS, recommend 470nF, and some chips do seem to need the larger capacitor.

Unless you are making the Vusb sense connection to the chip, you need to adjust the setting in the demo files to say this is not present. Both the serial examples, and the USB_HID example, assume that the sense connection is present on B0, and won't function, unless this is made, or this feature is turned off (add a line defining this to be '0', before loading the USB stuff in the examples). If this line is floating, it'd explain everything.....

I think the
Guest








PostPosted: Mon Jun 29, 2009 11:00 am     Reply with quote

I will try it, but I already disable this option.
Guest








PostPosted: Mon Jun 29, 2009 11:32 am     Reply with quote

I think that my code is correct on the sense pin mode:
Code:
#ifndef USB_CON_SENSE_PIN
 #define USB_CON_SENSE_PIN  0
#endif

This code is in "pic18_usb.h"...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 29, 2009 11:40 am     Reply with quote

That's the .h file. It's #included in the Ex_usb_hid.c example file.
The #define statement in the .h file is only compiled if the symbol is not defined elsewhere.

But it is defined elsewhere. It's #defined in the Ex_usb_hid.c file:
Code:

#define __USB_PIC_PERIF__ 1

///only the 18F4550 development kit has this pin
#if __USB_PIC_PERIF__ && defined(__PCH__)
 #define USB_CON_SENSE_PIN PIN_B2
#endif


So your program does use the sense pin.
jaderd



Joined: 26 Jun 2009
Posts: 19

View user's profile Send private message Send e-mail

PostPosted: Mon Jun 29, 2009 11:50 am     Reply with quote

I had reviewed these 3 lines, thus, is not without the sense pin?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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