jana1972@centrum.cz wrote 2011-11-08 08:25: > Hi Isaac, > Thank you for your reply. > So I used 1k resistor to ground RB4,also use 5V( direct power from ICD3 d= ebugger menu in > MPLAB) but still the same.I can not debug this very short program ( for = programming I use > Programmer choice in the Debugger menu). > Or must I programm it first via a programmer from Programmer menu ( not D= ebugger menu) > in MPLAB IDE? Program first, then debug. You can not debug if there is no program in the processor to debug. > > #include "P16F628A.INC" ; Include header file > __CONFIG _CP_OFF& _LVP_OFF& _BOREN_OFF& _MCLRE_ON& _WDT_OFF > &_PWRTE_ON& _INTOSC_OSC_NOCLKOUT > ;__config _XT_OSC&_LVP_OFF& _WDT_ON& _PWRTE_ON& _BODEN_OFF > > org 0 > NOP > movlw 0x07 > movwf CMCON > bsf STATUS,RP0 ;bank1 > BCF TRISA,2 > bcf STATUS,RP0 ;bank0 > BSF PORTA,2 > END > > Do you have any other idea? > Thanks > ? > > > >> Em 7/11/2011 17:05, jana1972@centrum.cz escreveu: >>> Hi Jim, >>> Thanks a lot for your time and help( my thanks to others who replied to= o) >>> >>> Unfortunatelly, I can NOT still use PIC16F648A - ICD >>> for the debugging of PIC16F628A. >>> >>> I can program code into PIC16F628A( using PICkit3) and it works as it s= hould. >>> >>> But I can not >>> program code ( using debugger ICD3 ) into PIC16F648A - ICD header and d= ebug the code >>> with ICD3. >>> >>> I receive the error >>> ICD3Err0040: The target device is not ready for debugging. >>> Please check your configuration bit settings and program >>> the device before proceeding. >>> >>> Stepping target failed >> >> >> > From the MPLAB ICD2 help, section "Limitations": >> >> " >> PIC16F648A Family Limitations >> PIC16F648A, PIC16F628A, PIC16F627A >> Headers are required for debug when using these devices. See the "Debug >> Header Specification" for details. Header limitations are as follows: >> >> General Debug Limitations >> General Programming Limitations >> You cannot single step through an interrupt >> Due to hardware restrictions the debugger/emulator cannot jump to the >> interrupt vector memory location in single step or animate mode. >> >> Program Memory standard flash >> Program memory not enhanced flash. You cannot program in low voltage >> mode (Vdd<4.5V.) See device programming specification for more informati= on. >> >> RCIF is cleared when RCREG is interrogated by software, except when >> Freeze on Halt is enabled. >> RBIF is cleared when PORT is interrogated by software. >> When driving a clock oscillator of more than 4 MHz into OSC1 in HS >> oscillator mode, the device will not go into debug mode. Therefore >> crystal caps will be required. The 32 kHz to 4 MHz range does not have >> this issue. >> Above 16MHz, in EC mode, a Reset executes the first few instructions >> instead of only 1 instruction. The workaround is to add 3 NOPs at the >> reset vector. >> Freeze on Halt Limitations >> This device family requires a header for debug. Header limitations are >> as follows: >> >> Timer0 will not freeze using the internal clock. >> Timer0 will not freeze using external clock. >> CMOUTx Pins do not freeze, status bits and interrupt flags do freeze. >> " >> >> >> Most important in my opinion: >> >> - You cannot program in low voltage mode (Vdd<4.5V.) >> - When driving a clock oscillator of more than 4 MHz into OSC1 in HS >> oscillator mode, the device will not go into debug mode. >> >> > From another section in the help: >> >> " >> If your code makes use of port pins that correspond to clock and data >> pins* in programming mode, you may not be able to reprogram your device. >> When Internal MCLR is used with the debugger/emulator for programming, >> both Vpp and Vdd are powered together, and then Vpp is pulled high to >> Vihh to enter programming mode. This means that your code will be >> running before Vpp goes to Vihh. If that code makes use of port pins >> that correspond to clock and data pins in programming mode, there is a >> chance their values may not be 0, as necessary to enter programming >> mode. Therefore, the device could not be reprogrammed. >> " >> >> >> Isaac >> >> -- >> 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 .