CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Err0040: The target device is not ready for debugging.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Geows



Joined: 05 May 2016
Posts: 11

View user's profile Send private message

PostPosted: Wed May 11, 2016 1:33 am     Reply with quote

OK, I found the error !

It was actually an error with the header file ! There are the same fuses, interruptions, ... but at the beginning there is a #device xxx and it needs to be the same as the one you are running (obviously ...) but I didn't pay attention to it (didn't noticed that at the beginning of the file).

Thank you a lot Ttelmah for your help ! If in my schematic you find anything weird to you or worse errors, please tell me !
Thanks again for the time you spent on looking for my errors !

Have a good day !
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Wed May 11, 2016 1:38 am     Reply with quote

You haven't got the correct circuit on the MCLR line for ICD.......

You need to either get rid of the capacitor, or have a diode, so the ICD can pull the line down, without being affected by the capacitor. Also the pull up is too small (22K to 47K recommended).
Quote directly from MicroChip:
"No capacitor should be used on MCLR or it will cause programming problems with the ICD."
Though in fact they qualify this later and show you in their example circuits how to use a capacitor if required.

As it stands, the ICD will not be able to properly operate the MCLR line, hence unreliable programming.....

You might well get away with the 10K, but the capacitor is what is causing the problem.

Look at the data sheet. Note how they show a jumper to disconnect this.

"During programming and debugging, the resistance
and capacitance that can be added to the pin must
be considered. Device programmers and debuggers
drive the MCLR pin. Consequently, specific voltage
levels (VIH and VIL) and fast signal transitions must
not be adversely affected. Therefore, specific values
of R1 and C1 will need to be adjusted based on the
application and PCB requirements. For example, it is
recommended that the capacitor, C1, be isolated
from the MCLR pin during programming and
debugging operations by using a jumper (Figure 2-2).
The jumper is replaced for normal run-time
operations."

What is happening is that some of the programming operations are not completing properly. Probably the full erase (hence the fuses don't change), and the writing of the debug executive.
Debugging itself does not use this pin, but the programming does.

On these chips, the MCLR does not go high like many of the older chips, so 10K is probably OK.
Geows



Joined: 05 May 2016
Posts: 11

View user's profile Send private message

PostPosted: Wed May 11, 2016 2:51 am     Reply with quote

I actually followed the schema in the datasheet where it is said to start with capacitance of 0.1µF and R1=10K and R2=470
So according to the datasheet it should be ok.

After yes, there is the case of the jumper but I didn't really pay attention because it was working. I'll see if I can fix this !
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Wed May 11, 2016 3:01 am     Reply with quote

The problem is that the data sheet is showing you how to connect MCLR for use as MCLR, not for ICD.
They do give the details of the jumper later.

There are much better circuits on the Microchip notes, for use with ICD, including warnings that some programmers won't actually like a resistor as low as 10K. However this generally applies to chips where MCLR has to go higher for programming.

Go here:
<http://ww1.microchip.com/downloads/en/DeviceDoc/50002011B.pdf>

And pull the poster for the ICD3.

Note the 50K resistor on MCLR, and the "Target Circuit Design Precautions".

Unless you must have delayed start-up, just remove the capacitor. You can give yourself a short delay, by just programming the PUT on the PIC.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group