I have seen these messages before... Try shutting down MPLAB, unplugginf the ICD2 at both the USB and external power, and disconnect your target board... Basically shut down everything. Then, plug in the ICD2 (power and USB), then the target board, and finally restart MPLAB. This fixes these issues for me. Rolf David wrote: > Hi, > > I am having trouble running the ICD 2 debugger with PIC18LF1320 target. > Currently running MPLAB 7.51 and Hi-Tech C compiler v9.5 PL3. > > All other projects work fine with the debugger (mainly PIC18LF2520 and > PIC18LF6720). > > Debugger -> Settings -> Status shows all pass and correct Vpp and Vdd. > In the configuration bits I have selected RC internal oscillator with > port pins on RA6,RA7. > I have Not enabled power up timer or watchdog timer or low power > programming. > > In the code I set OSCCON to 0x60 for 4 MHz internal clock. > > When I select Debugger -> Program, the following messages are shown. > > ************* > Programming Target... > ...Validating configuration fields > ...Erasing Part > ...Programming Program Memory (0x0 - 0x1E3F) > ...Loading DebugExecutive > ...Programming DebugExecutive > ...Programming Debug Vector > ...Programming RSBUG > Verifying... > ...Program Memory > ...Debug Executive > ...Debug Vector > ...Verify Succeeded > Programming Configuration Bits > .. Config Memory > Verifying configuration memory... > ...Verify Succeeded > Connecting to debug executive > ...Programming succeeded > 22-Dec-2006, 07:04:59 > > MPLAB ICD 2 Ready > ***************** > > When I attempt to RUN, the following messages are displayed. > > ************** > ICD0154: Invalid target mode for requested operation (TM = Running) > Running Target > ICD0154: Invalid target mode for requested operation (TM = Running) > ICD0069: Debug: Unable to run target > ICD0154: Invalid target mode for requested operation (TM = Running) > ICD0151: Failed to sync memory (MT = Data) (Dir = 0x0) > > ***************** > > I have spoken with both Microchip technical support(Sydney) and Hi-Tech > engineer but neither has been able to offer a solution or reason why > this would occur. > Any help much appreciated. Thanks > > Regards > > David > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist