On Fri, Mar 11, 2011 at 4:16 PM, Oli Glaser wrote= : > On 11/03/2011 10:34, Manu Abraham wrote: >> I am not really very sure, whether the port pins need to be setup for >> ICD. I had a quick look at the ICD2 user guide but didn't see any >> place mentioning that, maybe I overlooked. I will try looking again on >> that aspect. > > Have a look in the 18F452 datasheet under the config bits - there should > be a bit to enable the pins to be used for debugging rather than general = IO. Yes, thanks for the pointer. Bit:7 CONFIG4L (/DEBUG) /DEBUG =3D 1 Background debugger disabled /DEBUG =3D 0 debugger enabled So, I have now additionally: #pragma config DEBUG =3D ON But, still debugging doesn't seem to work. Connecting to MPLAB ICD 2 ....Connected Setting Vdd source to target Target Device PIC18F452 found, revision =3D c0 ....Reading ICD Product ID Running ICD Self Test ....Passed MPLAB ICD 2 ready for next operation Resetting Target MPLAB ICD 2 ready for next operation ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information. ICDWarn0015: Program memory has changed since last program operation? Continue with Debug operation? Running Target ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information. ICD0069: Debug: Unable to run target MPLAB ICD 2 ready for next operation --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .