View previous topic :: View next topic |
Author |
Message |
MJ Guest
|
PIC18F4550 USB |
Posted: Tue Jan 06, 2009 10:52 am |
|
|
Hi!
I have a big problem with my PIC18F4550 when trying the USB-virtual-COM-port in the ex_usb_serial example.
When I connect the PIC to the PC nothing happens.
I have a 20MHz Oszillator (PLL5, HSPLL, ...), put a 470nF cap close to the VUSB pin, have connected the pins 12 and 31 to ground, the pins 11 and 32 to +5V, there are 100nF capacitors between the + and gnd pins, I have tripple-checked the right connection of the USB-connector and I know that the program is running on the pic 'cause I've included some LEDs blinking at the beginning of the program.
What could be my problem? |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Tue Jan 06, 2009 12:00 pm |
|
|
Okay....I have a new problem now...
I have a self-developed evaluation-board and I have lead-through all pins except the oscillator pins to put the evaluation board on a pinboard.
Now I accidentially touched some pins from the board and abruptly the PC found the USB-UART-Device...
Now sometimes it works and sometimes not... when not, I have to touch some pins again and so on...
But that are not any specific pins...
what should I do? |
|
![](templates/subSilver/images/spacer.gif) |
kamputty Guest
|
|
Posted: Tue Jan 06, 2009 3:22 pm |
|
|
maybe a ground issue? |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Wed Jan 07, 2009 1:36 am |
|
|
I don't think that it is a ground problem...
I've gauged all the ground pins of connectivity (the two pins of the pic, the gnd pin of the usb-connector (and also the shielding) and the 470n cap at the vbus pin)...
And I think I don't need more gnd connections, do I?
Aja...and I have not connected a USB_Connection_Sense_Pin and have commented out these lines in the ex_usb_serial... |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Jan 07, 2009 4:06 am |
|
|
Obvious comments that apply:
1) Have you got the fuse 'NOMCLR', or the MCLR line pulled up?.
2) Have you got the fuse 'NOLVP', or have a pull down resistor on RB5.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Wed Jan 07, 2009 5:05 am |
|
|
I have lined the MCLR up to +5V
and I have used the #fuse NOLVP |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Wed Jan 07, 2009 8:22 am |
|
|
I found out that I have not the 3V but alway between 0V and 0.5V or so on the VBUS pin, where the cap is lined to ground.
But I have used the #fuse VREGEN.
I don't know where the problem is... |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Jan 07, 2009 10:18 am |
|
|
OK.
I suspect your problem is the removal of the code for the connection sense pin. Don't.
The connection sense pin is _automatically_ not used, unless you define it. If you add the line:
#define USB_CON_SENSE_PIN 0
In front of the point where you load the first USB file, or leave the pin undefined, it is not used.
The connection sense pin is used in a lot of parts of the CCS code. I think what has happened is that you have removed part of it, and left the code non working.
The behaviour is 'classic', that the code is not seeing the attachment, and so is not waking up the USB peripheral.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Wed Jan 07, 2009 3:17 pm |
|
|
Okay... I think you where right, that I changed something...I have reproduced the whole project now and included the original ex_usb_serial.c.
First it didn't work and I included some LEDs blinking at the beginning of the main function to see if the PIC is already running.
I tried it...they were blinking...great...But nothing with the USB.
Then I included a LED blinking at the beginning of the usb_debug_task()-function (LED on, delay for 500ms, LED off, delay for 500ms).
I tried it...it was blinking...great...and then after about 7-10 seconds (so when the PIC jumped into the usb_debug_task() the 7th time...) I heard the windows-sound when a usb-device is plugged in...and the voltage on the vusb pin rose to 3.3V. Then I installed the driver and everything seemed to be great, but I did not get any message in the hyperterminal...
So I unplugged the PIC and then plugged it again to the PC ... -> exactly the same procedure as before (10sec., driver, ...).
Then I tried to remove the code that makes the LED blinking in the usb_debug_task()...-> when I plugged the PIC to the PC nothing happend...
Has anybody had so strange troubles with the 18F4550 as I have?
Regards! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Thu Jan 08, 2009 3:02 am |
|
|
The default EX_USB_SERIAL, uses the connection sense, on pin B2. If you haven't got this connected, and the pin is floating, then you could get behaviour like you are describing, if this pin is floating....
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
MJ Guest
|
|
Posted: Thu Jan 08, 2009 3:23 pm |
|
|
Thank you so much...
Now the example works...
So i will write my own code now...hopefully working...gg
Regards |
|
![](templates/subSilver/images/spacer.gif) |
bnolan Guest
|
USB Problems |
Posted: Tue Jan 27, 2009 3:09 pm |
|
|
I have the same problem as MJ. I am using the pic18 4550. I have duplicated a working circuit for our keyboard and made it smaller for use in a trackball application. I use the same programming so I know it is not that. My small board is not recoginzed. I can get it to work if I change the Vusb cap to .47uf and hold the ground end of a multi meter on the ground end of the cap. Any suggestions??? |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
Re: USB Problems |
Posted: Mon Feb 02, 2009 3:43 pm |
|
|
bnolan wrote: | I have the same problem as MJ. I am using the pic18 4550. I have duplicated a working circuit for our keyboard and made it smaller for use in a trackball application. I use the same programming so I know it is not that. My small board is not recoginzed. I can get it to work if I change the Vusb cap to .47uf and hold the ground end of a multi meter on the ground end of the cap. Any suggestions??? |
The problem was that pins 8,9,10 & 11 have to be grounded because they were being used for PS/2. I had them floating. |
|
![](templates/subSilver/images/spacer.gif) |
|