I think you'd better clear some issues out. In this thread you have earlier asked about the PIC16F628A, see further down in this post. *Now* you post a code snipped with an #include for a PIC18, but the code doesn't seem to be for a PIC18. You definitely have some homework to do here. Please explain what you *realy* are trying to do. And exactly *what* hardware are you using ? *What* processor are you trying to debug ? Jan-Erik. jana1972@centrum.cz wrote 2011-10-22 18:58: > Chris , > Thanks. > Now Pickit3 can power demo board without external power > Thanks again. > > But still I can not DEBUG a program.I have this very simple program > > #include > CONFIG FOSC =3D INTIO7 > =09 > org 0 > Start: > BSF STATUS,1; select Register Bank 1 > BCF TRISD,0 ; make IO Pin RD0 an output > BCF STATUS,0; back to Register Bank 0 > BSF PORTD,0 ; turn on LED RD0 (DS0) > > END > > It works, LED is ON, but can not debug. > I receive the error > > PK3Err0040: The target device is not ready for debugging.Please check you= r configuration > bit settings and programthe device before proceeding > > Can anyone help? > Thanks > > L. > > >> Select Debugger Menu. >> Settings... >> Power Tab >> Tick "Power target circuit from PICkit3" >> >> Have fun :) >> >> 2011/10/22: >>> Chris , >>> Thank you for your reply. >>> >>>> You should be able to power the PIC with the PICKit3. >>> I am not sure of that. >>> If I connect PICkit3 only to a board with PIC, ( and no external power= is there), >>> MPLAB( I am using) does NOT recognise any target device being connected= .. >>> ( I tested that with 44 pin demo mainboard by Microchip ) >>> But as soon as I connect the external power to the mainboard, target de= vice is recognignised >>> >>> >>> >>> >>>> Look at the pin outs for the PIC16F628A and connect them to the >>>> corresponding pins on the PICKit3 and you should be good to go, as >>>> long as the PICKit3 is connected and is Powering the PIC. >>>> If you need to run the PIC with the PICKit3 disconnected, you will >>>> have to then provide external power and also hold MCR high, refer >>>> again to the PIC PDF. >>>> >>>> >>>> On 22 October 2011 15:22, wrote: >>>>> Thanks for your reply >>>>> I thought that PICkit3 works as >>>>> a debugger and a programmer >>>>> >>>>> So, when I compile a sample program >>>>> I must upload to ( program) a microchip, in my case to PIC16F628A. >>>>> Only after that I can debug it. >>>>> Is it so? Or working with PICkit3 is different? >>>>> >>>>>> The simplest is that it has just power. >>>>> Do you mean only + and - and that is ALL? >>>>> >>>>>> Use the internal oscillator >>>>>> and disable MCLR >>>>> But do you think that internal oscilator is important for PICkit3 to = recognise PIC16F628A? >>>>> I thought that MCLR is set up in config and has not any influence on= PICkit3 in finding the >>>>> PIC16F628A. >>>>> >>>>> >>>>> PICkit3 requires only these signals >>>>> Vpp >>>>> VDD Target >>>>> Vss >>>>> PGD >>>>> PGC >>>>> PGM >>>>> >>>>> Does it mean that if I connect these 6 signals to PICkit3 and power t= o PIC16F628A , >>>>> PIC16F628A must work? >>>>> >>>>> Thanks >>>>> L. >>>>> >>>>> >>>>>>> Can anyone suggest the simplest connection of PIC16F628A? >>>>>> >>>>>> The simplest is that it has just power. Use the internal oscillator >>>>>> and disable MCLR >>>>>> >>>>>>> Target Device ID (00000000) does not match expected DeviceID (00001= 120). >>>>>> >>>>>> Are you connecting to the correct pins for programming ? Double >>>>>> check. How you have the 628 configured for run-time shouldn't >>>>>> affect the programmer (as long as any circuitry isn't interfering wi= th >>>>>> the programming) >>>>>> >>>>>>> so I am not sure if the PIC is faulty >>>>>> >>>>>> Unlikely, but not impossible of course >>>>>> >>>>>>> or the schematic is faulty >>>>>> >>>>>> Hmmmm >>>>>> >>>>>>> Is 3.6V as power supply enough? >>>>>> >>>>>> Yes. Vdd is 3V - 5.5V >>>>>> -- >>>>>> http://www.piclist.com PIC/SX FAQ& list archive >>>>>> View/change your membership options at >>>>>> http://mailman.mit.edu/mailman/listinfo/piclist >>>>> >>>>> >>>>> -- >>>>> http://www.piclist.com PIC/SX FAQ& list archive >>>>> View/change your membership options at >>>>> http://mailman.mit.edu/mailman/listinfo/piclist >>>>> >>>> >>>> -- >>>> http://www.piclist.com PIC/SX FAQ& list archive >>>> View/change your membership options at >>>> http://mailman.mit.edu/mailman/listinfo/piclist >>> >>> >>> >>> -- >>> http://www.piclist.com PIC/SX FAQ& list archive >>> View/change your membership options at >>> http://mailman.mit.edu/mailman/listinfo/piclist >>> >> >> -- >> http://www.piclist.com PIC/SX FAQ& list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist > > > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .