View previous topic :: View next topic |
Author |
Message |
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Fri Jan 24, 2014 6:47 am |
|
|
thanks for the reply, I've been really confused about this one. I'm starting to think the USB failure is a side effect, like you noted about the master clock. I will try adding the resistor to the clock input.
One question though, when I lock up the device and the MCLR doesn't work I can initiate the bootloader without power cycling???? This doesn't make sense to me. Why would that function (holding the prog button on the board and cycling the reset) but my code won't reset?
I also noticed that the board will reliably lock up when I get near the bottom of the board where vias are located directly under the chip. There are 5 vias in a row (VPP, Vcc, GND, and then 2 i can't follow.) I'm going to trace the 2 unknown pins because the last one in the row when touched will always cause the lockup.
thanks Dan |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Fri Jan 24, 2014 7:04 am |
|
|
OK, that last pin is PGC for ICSP. If I configure those pins as outputs then the usb won't start and I think the pic hangs because the heartbeat LED won't blink. I change B to inputs and it will start but hang if i touch B7.
Is some internal ICSP mode initiating?
thanks,
Dan |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19257
|
|
Posted: Sat Jan 25, 2014 1:59 am |
|
|
I'd say look at your bootloader code.
Suspicion is that it is actually getting to the bootloader, and getting hung inside this. If (for instance), a reset is being triggered, and whatever condition you use to trigger the bootloader is being 'met', it gets here, then sits not receiving data, so is hung...
Thing is that every part of the code needs checks. So (for instance), have the bootloader automatically cancel if data is not received in (say) ten seconds, to avoid exactly this, and also make sure that the 'trigger' cannot happen normally.
Best Wishes |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Sat Jan 25, 2014 3:24 pm |
|
|
so the quick and dirty fix, is to tie Port B.6 to GND, with it configured as an input. With this in place the USB works fine and there are no lockups while handling the board anywhere. Very odd, but it works. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19257
|
|
Posted: Sun Jan 26, 2014 1:28 am |
|
|
It's not possible you are compiling through MPLAB?.
Remember if so, this turns ICD on by default, and in this case B6 would need to be pulled low. |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Sun Jan 26, 2014 6:36 am |
|
|
I am compiling through MPLAB, never ran into this before or never noticed it I guess. Where do you turn that off?
Thanks,
Dan |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
solved |
Posted: Sun Jan 26, 2014 7:15 am |
|
|
Yup, that was the problem. I changed the build setting to RELEASE, from DEBUG and everything works perfectly. Thanks for the tip.
Dan |
|
|
|