View previous topic :: View next topic |
Author |
Message |
manisha
Joined: 03 Feb 2012 Posts: 29
|
USB with 18f2550/18f4550 |
Posted: Fri Jan 25, 2013 6:48 am |
|
|
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
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Fri Jan 25, 2013 1:00 pm |
|
|
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
|
usb device not recognised |
Posted: Tue Jan 29, 2013 6:00 am |
|
|
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
|
|
Posted: Tue Jan 29, 2013 6:16 am |
|
|
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: 19549
|
|
Posted: Tue Jan 29, 2013 8:40 am |
|
|
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 |
|
|
|