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

USB with 18f2550/18f4550

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



Joined: 03 Feb 2012
Posts: 29

View user's profile Send private message

USB with 18f2550/18f4550
PostPosted: Fri Jan 25, 2013 6:48 am     Reply with quote

Haiii.....
I am new to usb programming. I have tried to program the Example code available in the PICC compiler i.e ex_usb_hid and also some general codes and even Microchip stack related to usb but the device is not recognised by the PC. Can anyone please tell me actually what is the driver to interface USB or any example code? Controller and oscillator frequency everything is fine......20Mhz but configured for 48Mhz. using fuses HSPLL,NOWDT,NOPROTECT,NOLVP,USBDIV,PLL5,CPUDIV1

Expecting a quick response.....
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 25, 2013 12:12 pm     Reply with quote

How to make the Ex_usb_hid.c example work:
http://www.ccsinfo.com/forum/viewtopic.php?t=38897
Ttelmah



Joined: 11 Mar 2010
Posts: 19548

View user's profile Send private message

PostPosted: Fri Jan 25, 2013 1:00 pm     Reply with quote

The obvious missing fuse is VREGEN.

Also suitable capacitor on Vusb?. The whole connection will not work unless there is a nice stable voltage here.

Best Wishes
manisha



Joined: 03 Feb 2012
Posts: 29

View user's profile Send private message

usb device not recognised
PostPosted: Tue Jan 29, 2013 6:00 am     Reply with quote

I have enabled the vregen fuse for 3.3volts for usb and also connected the 2 capacitors (100nf) in parallel on Vbus pin and I got voltage as 3.04volts on that pin and next time connected 2 tantalum 2.2uf capacitors in parallel and got 3.37volts on that pin. And the device is entering into the enumeration i.e usb_enumerated(); function but still when connected to PC it shows as usb device not recognised or it is malfunctioned

I have changed the curr_config to the value of 2 at all places to get into the function usb_enumerated(); .

Also I have tried with the ex_usb_serial2.c and previous HID from PICC examples.

Do we need any specific drivers for pic to pc communication to install into the PC (WIndows XP)?

PLease tell me where I need to modify?
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jan 29, 2013 6:16 am     Reply with quote

CCS supplies an INF file for XP that you must install..It's either in the examples folder or the devices folder. Documentation is in the beginning of one of the drivers.

I do know their cdc example works fine.

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19548

View user's profile Send private message

PostPosted: Tue Jan 29, 2013 8:40 am     Reply with quote

The driver will solve things, _once_ Windows starts asking for it. At present, Windows is seeing a device, but is not enumerating properly. It'll ask for the driver, once enumeration completes.

Next thing, is to triple check you have D+, and D- wired the right way round (if these are reversed, Windows will see a device - this is triggered by the pull up resistors inside the chip, but it won't enumerate).

Other things that can cause problems:
1) Bad wiring to the USB connector. Overlong connections, or high capacitances here.
2) Crystal out of tolerance or timing fuses set wrong. Do a simple 'toggle an LED' test, and verify that (for instance) if you program it to flash every 10 seconds, it does. Something like much too large loading capacitors on the crystal, would cause behaviour like this.
3) If the device is not being powered from the USB bus, then technically connection sense is _required_. A lot of people try to run without this to save a pin, then get intermittent problems.

The CDC example does work. Forget fiddling, and use this, till you know the hardware is right.

Don't think that 'bigger is better' on the Vusb capacitor. The recommended value is 0.22 to 0.47uF. Go much higher, and it can cause problems. Your 2*0.1, was a little small. Get a 0.47uF polypropylene capacitor and use this.

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