PDA

View Full Version : USB HID is slower than often using PIC18f2550



Ahmadabuomar
- 15th November 2010, 14:54
Hi all,

I was working on USB HID and CDC last weeks with successful applications using 18f2550.

I made alot of codes and tested them on breadboard.

yesterday, i made a prototype PCB for my pic 18f2550.

the problem is that, i find that my labtop takes more time to recognize my HID device.

when i was using breadboards, my labtop recognize PIC almost instantly. but now it takes about 10 seconds to see it(every time i plugg it , not only the first time). i tried to change the usb capacitor to 470nf insread of 220nf. but nothing changes.

the program works fine. HID device is ok and communicates will with pc. but i need to know why is it slower to be recognized now? provided that i didnt change any component when i moved from breadboard to PCB.

Darrel Taylor
- 15th November 2010, 19:27
Are you powering your circuit from the USB ports +5V?
If so, it's likely the delay is in your reset circuit on MCLR.

Quite often people will put a capacitor on MCLR, thinking it will be more stable and not reset.
But instead it just adds several seconds to the power-up reset time.

MCLR is usually a Schmitt Trigger input, so the capacitor has to charge to over 4V before it releases the PIC from "RESET".

If you have a cap there, try removing it.

Ahmadabuomar
- 16th November 2010, 00:39
Yes i m using USB rail to power up my MCU. but i dont use a capacitor on MCLR.

I only use a 4k7 resistor connected to USB (+5v) supply.

the strange thing is as i said before, i m using the same circuit i tested on breadboard where it was working fast without any delay on power up.

i double checked crystal capacitors ( 4MHz with 22p farads) they are as stated in the datasheet.

i also checked the voltage coming out from USB, it was 5.6v

the MCLR pin comes to 5.5 volts instantly after attach it to usb as i m using only 4k7 resistor without any capacitor.

Darrel Taylor
- 16th November 2010, 01:02
Well, if it is truely the exact same circuit, and exact same program ...
About the only difference between a breadboard and a PCB is the extra capacitance inherent in the breadboard.

Do you have at least one 0.1uF capacitor between VDD and VSS close to the PIC?
And maybe a 10uF cap close to the USB port?
Is "Low Voltage Programming" disabled in the configs?
Is IESO disabled?
Is it the exact same crystal? Parallel or series cut?

Ahmadabuomar
- 16th November 2010, 03:29
thx darrel,

I already have 100nf ceramic capacitor between vdd and vss so close to PIC.

LVP disabled, IESO disabled

i have 100nf close to used connector.

the crystal is the same. i dont know if it is parallel or series cut. but i know it is connected parallel with two filtering capacitors 22p at each leg. it is connected as in datasheet.

any idea whats going on?

i ll try to use 10uf close to usb ( even i think its a huge capacitance as much as USB port is concerned) and i ll see if it will solve the problem

see u tomorrow, thx darrel

mackrackit
- 16th November 2010, 04:25
Do you have a capacitor between VUSB and VSS? What value?

Can you post the schematic and/or the board layout?

Ahmadabuomar
- 16th November 2010, 14:05
yes, i have mentioned that in the first post.

i have a 220nf capacitor on Vusb. i changed that to 470nf, still nothing changed

here is simple schematic for basic connections

4951