| View previous topic :: View next topic |
| Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 20159
|
|
Posted: Sat Jun 11, 2011 2:50 am |
|
|
How is the PIC supply generated & smoothed?.
USB is 'tighter' on it's requirements here than the rest of the chip (the voltage regulator to generate Vusb, has not got much margin).
How is your master clock generated?.
Things that can cause this:
1) Supply problems, especially on Vusb, and since this is derived from Vdd, here as well.
2) Track layout problems on the USB connections to the PIC.
3) Clock being fractionally off spec. Using things like resonators, rather than a crystal, or getting the loading capacitances wrong for a crystal.
Best Wishes |
|
 |
javick82
Joined: 12 Jul 2007 Posts: 43
|
|
Posted: Sat Jun 11, 2011 2:57 pm |
|
|
Oddly enough, this same thing occurs when I use the CCS USB demo board as well.
I used the same fuses and clock setup as laid out in the USB exercise book. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20159
|
|
Posted: Sun Jun 12, 2011 2:11 am |
|
|
OK.
I'd suggest you have to try two things:
1) Test in a completely different location. If you have hardware with anything like electrical control in it, test without this.
2) Test with different software. Just use (say) the serial example in the demo board, and try sending something like a 4MB file to it, set up at 9600bps, from a terminal package.
Obviously I assume you have tried a completely different USB cable?.
EM interference is one possibility (hence the first), and a problem with your software the second.
The USB connection to a PIC, _can_ be very reliable. Have some units logging data via USB, that have continuous records over 6+ years, and some with more recent software written with CCS, that have been going for the last couple of years.
Best Wishes |
|
 |
javick82
Joined: 12 Jul 2007 Posts: 43
|
|
Posted: Mon Jun 13, 2011 6:45 am |
|
|
I had the same line of thinking, Ttelmah...
Brought the sucker home over the weekend. I ran the same example 12 program for 16 hours straight with no issues. I used a different (brand new) USB cable and obviously my home PC.
I am going to try the same thing at the office with the USB cable and if that has issues, I've got a new USB PCI card on its way.
FYI, I was using the Serial I/O Monitor that ships with CCS Load in both locations.
What a headache!!! |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20159
|
|
Posted: Mon Jun 13, 2011 10:00 am |
|
|
'In the office', consider things like air-conditioning, heaters, photo-copier's etc..
Best Wishes |
|
 |
javick82
Joined: 12 Jul 2007 Posts: 43
|
|
Posted: Wed Jun 15, 2011 2:48 pm |
|
|
So if the device is USB powered, I have no issue sustaining a connection forever.
It is only when I use an external power supply that the issue crops up. My EE is going to look into some conditioning and proper grounding.
Thanks for the help and insight, I will keep the board up-to-date with any new information in case someone runs into the same issue. |
|
 |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Jun 15, 2011 11:24 pm |
|
|
| I can report a similar case with an AVR ATmega USB processor, where power supply spikes caused strong reactions of the PLL and accidental USB connection drops. Power supply filtering according to the manufacturer recommendations could eliminate the issue. |
|
 |
petejacobs
Joined: 22 Jun 2011 Posts: 1
|
| Similar issue with PIC18LF26J50 |
Posted: Wed Jun 22, 2011 11:33 am |
|
|
| I am seeing the same issue. I am using a nearly identical set-up as you. I have a C# application running the Serial IO to communicate with a PIC18LF26J50 over USB CDC implementation. I can send a 1-byte command from the PC to the PIC and receive a one byte command back from the PIC. But on subsequent sends, the data arrives at the PIC as it should (I can see it using the MPLAB ICD2), but the reply never arrives back at the PC. The PIC won't appropriately send the reply data to the PC until I unplug the USB port, plug it back in, and reinitialize the port. I have verified that there are no differences between the USB-relevant registers on the first transmission/reception (which is successful) and the second transmission / reception (which fails). Also the code path for transmitting the data from the PIC is identical on both a successful reply and a failed reply. Per an earlier suggestion on this forum, I tried running this by powering just over the USB, but this did not fix the problem, so maybe the root of my problem is different from the one described in this forum as I see it has fixed the original poster's issue. Has anyone found a solution to this? Thanks in advance for your feedback, Pete |
|
 |
|