5011 dspic
Microchip forums have a very annoying feature. The search function does not operate as it should (somewhat erratic behaviour) and posting yet another ICD2 debug with 30FXXXX will make me feel stupid as they ask me "...did you used the search...?"
Your suggestions with the oscillator: I tried them already last week and they do help some devices connect, however debugging is still not possible as after a while the debugger loses connection again on device A, and fails to enter into debug mode at all on device B. But withouth fiddling with the oscillator the debugger wouldn't even recognise nor connect to device B. I don't think the oscilator itself should be involved when connecting and recognising the device (so the above effect is weird to me), but it defenitely has a cardinal role when debugging the device.
One of the first things I checked was the oscillator (it ran fine) and voltages on supply pins (analog supply too). Looking at the signals PGC and PGD, one can see the RC curve (the level on those pins has enough time to reach full scale voltage) and no coupling artefacts. Writing to pic is I think 2x faster as is debugging, judgeing by the length of the packets.
On device A I had supply pins very close to the supply pins. Two single 100nF (X7R) capacitors shared supply pins on the +Vio rail for the whole 5011 directly under the package. There was another 100nF less than 2cm away from the analog supply pins. The digital supply was filtered once with a LC+100n and the analog pins had yet another (same design) filter.
The oscillator fail never occurs, none of the traps does, unless I trigger them manually. But I will probably follow your advice.
I have two ICD2 cables. One is approx 0.5m in length and was used to develop everything we have and another which is about 15cm in length. Both work the same.
Oh, and on my PDC/PGD pins and nMCLR:
device A:
PGC: 4k7 pull-up (pin will be used for jumper when not debugged)
PGD: 4k7 pull-down (pin will be used for jumper when not debugged)
nMCLR: 4k7 pull-up, then 10k pull-up, then 1k pull-up than back to 4k7 pull-up.
device B:
nothing except the nMCLR pull-up
Curious, you seem to be "new" with the PIC in general, why did you choose the such an advanced dsPIC30F5011; a somewhat difficult although powerful PIC for your project?
What makes you think that? Why is 5011 supposed to be difficult?