Jim and others Thank you ALL for your replies @Jim. I programmed code into my PIC16F628A with PICkit3 and saw it worked -= LED was shining on a particular port @Jan-Erik Soderholm - I used only PIC16F628A itself no other parts .I use= d internal oscilator.Red numbers are the pin numbers of PIC16F648A-ICD, black numbers = are pin numbers of PIC16F628A. @Isaac >There is one pin in PORTB (I think it is RB4) that must be kept at logic >level zero (at least until the ICD detects the device and enters debug >mode) for the debugger to work. Do you think connecting that port RB4 to the ground would be OK? >Besides, you must not use internal oscillator together with MCLR >disabled or else it won't enter debug mode. But I do not think I disabled MCLR. __CONFIG _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF &_PWRTE_ON & _INTOSC_OSC_NOCLKOUT Thanks again for help L. > > L., > > regarding your question... "Is that nescessary or just a good > advice?", > according to Microchip, it is necessary. > > Just as an FYI, your are programming your code into the 648 pod, or at > least trying to, before you try to debug it, correct? > > > Regards, > > Jim > > > -------- Original Message -------- > > Subject: RE: [PIC] IS this faulty? > > From: jana1972@centrum.cz > > Date: Mon, November 07, 2011 1:05 pm > > To: "Microcontroller discussion list - Public." > > > > > > 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 > > > > Can anyone help? > > Thanks > > L. > > > > > > > > > > > > > > > > > > > > > > One other thing I just remembered, when using the ICD, location '0x00= ' has > > > to be a NOP. > > Is that nescessary or just a good advice? > > > > > > I have added that in the code I have included here. Although what I = am > > > about to say goes > > > Against what I said above about not changing in midstream, you might = want to > > > try the code > > > I have included to see if it works. > > > > > > Let me know what you find out. > > > > > > My code snippet is... > > > > > > > > > > > > #include "P16F628A.INC" ; Include header file > > > ; CONFIG=3DCP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & = _PWRTE_ON > > > & _INTOSC_OSC_NOCLKOUT > > > > > > _CONFIG =3D 0x2170 ; I like writing it this = way > > > to save space. But that's just me. > > > ; It does the same thing as > > > the "CONFIG" line above. > > > org 0x0 ; Start at location zero, not 0x10 > > > start > > > nop ; For ICD use, location zer= o > > > has to be a 'nop' > > > movlw 0x07 > > > movwf CMCON > > > bsf STATUS,RP0 ;bank1 > > > bcf TRISA,2 > > > bcf STATUS,RP0 ;bank0 > > > toggle > > > bsf PORTA,2 > > > call delay ; Sets up a short (20us) > > > delay to give a little time between flashes > > > bcf PORTA,2 ; Added this to give more operation= s > > > to look at > > > call delay > > > goto toggle ; Causes the program to repeat the > > > flashing action > > > goto start > > > > > > > > > > > > delay > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > goto $+1 > > > return > > > > > > > > > END > > > > > > Regards, > > > > > > Jim > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Beh= alf Of > > > jana1972@centrum.cz > > > Sent: Saturday, November 05, 2011 12:56 PM > > > To: Microcontroller discussion list - Public. > > > Subject: RE: [PIC] IS this faulty? > > > > > > Jim , > > > Thank you for your reply. > > > But do you think that I can also use an internal oscilator instead? > > > I successfully programmed ( into normal PIC16F628A) this code > > > > > > #include "P16F628A.INC" ; Include header file > > > __CONFIG _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF = & > > > _PWRTE_ON & _INTOSC_OSC_NOCLKOUT > > > > > > org 10 > > > movlw 0x07 > > > movwf CMCON > > > bsf STATUS,RP0 ;bank1 > > > BCF TRISA,2 > > > bcf STATUS,RP0 ;bank0 > > > BSF PORTA,2 > > > END > > > > > > As you can see it uses internal oscilator and it works in normal PIC1= 6F628A > > > / 648A > > > but still it does not work in PIC16F648A - ICD, no debugging possible= .. > > > Must I use external oscilator with PIC16F648A - ICD or also internal > > > oscilator must work? > > > Thanks again > > > L > > > > > > > > > > Let me try this again. > > > > > > > > PGC and PGD are RB6 and RB7 respectively. In your schematic you sh= ow the > > > > PGC and PGD pins going to the OSC1 and OSC2 pins. > > > > This is why there is no ICD functionality with your circuit. > > > > > > > > If you connect the ICD pins to OSC1 and 2, you effectively disable = the > > > > oscillator. > > > > > > > > Try moving the ICD PGC and PGD pins to RB6 and RB7. You should be = able to > > > > use the ICD then. > > > > > > > > Regards, > > > > > > > > Jim > > > > > > > > -----Original Message----- > > > > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On B= ehalf > > > Of > > > > jana1972@centrum.cz > > > > Sent: Saturday, November 05, 2011 9:45 AM > > > > To: Microcontroller discussion list - Public. > > > > Subject: Re: [PIC] IS this faulty? > > > > > > > > Thanks ALL who replied. > > > > I do use capacitors in the schematic. > > > > Please see the schematic here > > > > http://www.dilynamobily.cz/Media/Uploaded/Normal/Problem.jpg > > > > ( the link is case sensitive) > > > > > > > > My problem is that I can not debug any program using PIC16f648A - I= CD > > > > > > > > Please check and let me know if you can see any problem > > > > Thanks > > > > L. > > > > > > > > > > > > > OK, whatever. > > > > > > > > > > We don't know for sure if there are any capacitors or not. > > > > > And if not, isn't it a possible "problem" ? > > > > > I think it is. > > > > > > > > > > > > > > > jim wrote 2011-11-05 14:53: > > > > > > > > > > > > The main reason for the capacitors in a crystal circuit is to p= rovide > > > an > > > > > > intentional imbalance between the input of the oscillator and o= utput > > > pin > > > > of > > > > > > the oscillator so that when power is applied, the imbalance cau= sess > > > > current > > > > > > to flow, and thereby guarantees the oscillator will start oscil= lating. > > > > > > > > > > > > Jim > > > > > > > > > > > > -----Original Message----- > > > > > > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] = On > > > Behalf > > > > Of > > > > > > Isaac Marino Bavaresco > > > > > > Sent: Saturday, November 05, 2011 7:45 AM > > > > > > To: Microcontroller discussion list - Public. > > > > > > Subject: Re: [PIC] IS this faulty? > > > > > > > > > > > > Em 5/11/2011 10:57, Jan-Erik Soderholm escreveu: > > > > > >>>> I *think* that the header is useless without a target circui= t. > > > > > >>> But what is the smallest target circuit?I thought adding only > > > crystal > > > > is > > > > > >>> OK for starting debugging > > > > > >> Right, but a crystal is useless without capacitors. And it is > > > > > >> a bit unclear how the header is powered. > > > > > > > > > > > > > > > > > > Not exactly. It may become unstable, or not to oscillate at all= , but > > > it > > > > may. > > > > > > > > > > > > > > > > > >>> Sorry, I have just only started with microchips - so a lot = of new > > > > > >>> knowledge for me to learn. > > > > > >> It's not about learing PICs, it's about telling everything and > > > > > >> not hiding details. :-) > > > > > > > > > > > > > > > > > > By my experience with teaching newbies in electronics and > > > > > > microcontrollers, it takes time to notice that there's missing > > > > information. > > > > > > Because of this, I generally take it easy with them. > > > > > > > > > > > > > > > > > > Isaac > > > > > > > > > > > -- > > > > > 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 > > > > > > -- > > 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 .