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

PIC18F14K22 can't debug

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PIC18F14K22 can't debug
PostPosted: Tue May 24, 2011 6:14 pm     Reply with quote

I'd like to hear from anyone out there who has successfully debugged a PIC18F14K22 using either MPLAB or CCS IDE using a ICD3 or RealICE. I have a simple project underway and have not been able to debug. Keep getting ICD3Err0040: The target device is not ready for debugging....

Using an internal oscillator.

Can anyone give me a suggestion on a working set of configuration bits?

Have checked all electrical connections, MCLR 10K pull-ups, etc. Don't consider myself a newbie, but this one has me stumped Embarassed I've surf the forum and find nothing that seems to suggest a fix here.

Sorry, getting pretty frustrated. But, thanks for any help! Very Happy
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 24, 2011 7:49 pm     Reply with quote

You had an earlier thread which you could have continued...
This is really a Microchip question. You should either post in their ICD3
forum, or register and enter a Trouble Ticket with their support group.

You didn't give your version of MPLAB. Using Google, I found one post
where they say a certain version of MPLAB doesn't work with the ICD3
and the 18F14K22.
http://www.microchip.com/forums/m513878.aspx
Also:
http://www.microchip.com/forums/m515556-print.aspx


Actually, looking a little bit farther into it on their forum I found this:
http://www.microchip.com/forums/m552377.aspx
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Wed May 25, 2011 5:29 am     Reply with quote

Hello again PCM:

Yes, you're right about the post, sorry. I'll continue from here exclusively on this issue .

I'm using v8.53 MPLAB and v4.121 CCS PCWH

I'm not sure it is the debugger or MPLAB, since I've tried a ICD-U64, ICD3, and a Real ICE and get the same results. Also, CCS IDE locks up when I attempt to run the debugger in it.

Using one of my Microchip evaluation boards, using a 18F45K20, I have the same error when attempting to debug. However, replacing the 18F45K20 with a 18F4520, using the same configuration bits (generated by CCS PIC WIzard), it debugs fine. I think it may have to do with the PIC Wizard configuration bits.

Again, thanks very much for your interest in my issue and I'll follow-up with your Microchip forum postings.
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Wed May 25, 2011 5:35 am     Reply with quote

Just read your forums PCM, and they were an eye-opener. I think I will contact MC to see what's-up on the 14K22 issue and try 8.50 MPLAB.

More later...here

Regards
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

SOLVED. THANKS PCM
PostPosted: Wed May 25, 2011 4:26 pm     Reply with quote

PCM:

SOLVED!

Thanks for your kind reply and suggestion. I updated MPLAB to 8.70 from 8.53 and debug problem was solved! Now to make-up two lost days. I attempted to investigate the issue further with Microchip, but their website has been up and down all day.

It also helps to know that disabling WDT, PUT and LVP are also essential to debug here.

I also note that, for at least for now, the DEBUG/RELEASE window in MPLAB is "greyed out". I'll investigate this later.

Thanks again
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 25, 2011 4:54 pm     Reply with quote

Quote:

I also note that, for at least for now, the DEBUG/RELEASE window in MPLAB is "greyed out".

You can fix that by downloading and installing the latest CCS "plug-in"
for MPLAB. I did that recently and it fixed the problem.
Here's the direct link to the plug-in:
http://www.ccsinfo.com/downloads/setup_mplab_plugin.exe
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Thu May 26, 2011 5:06 am     Reply with quote

Super information, I'll give that a try. I'm assuming that that DEBUG/RELEASE control the /BKBUG bit in CONFIG4 register.

Thanks again. Very Happy
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu May 26, 2011 5:43 am     Reply with quote

I don't know what else the debug/release option does BUT I do know that downloading the program to a PIC while in the 'debug' build configuration will NOT allow the PIC to run 'normally'.The actual code sent to the PIC is different!
Since I've never used the 'debug' option,rather cut code/burn the PIC, test in the real world,the default was a pain. Talked to MC about it and they patched MPLAB v8.63+ to allow the default to be set by the programmer.
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Thu May 26, 2011 6:25 am     Reply with quote

Interesting. I think there is a small routine is uploaded to the PIC to support debug when you are in the debug mode. Released mode probably just uploads the code without the debug support code and releases the debug resources to be used normally.

Does this make sense? What do you think PCM?

Regards
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Thu May 26, 2011 9:24 am     Reply with quote

You don't have to 'guess'. It is in the data sheets (separate one on ICD for the chip families supporting it), and the firmware itself is with MPLAB (or CCS's is with the PCx compiler).
What the debug setting 'does', varies with the development tool selected. If you are using a hardware ICE, then no changes are normally made. However with ICD, several fuses are altered, and the firmware is also loaded into the chip. How much ROM/RAM is used depends on the chip involved, but there is normally at least one stack level, a small amount of RAM, and some ROM. In MPLAB, if you search in the debugger reference for the ICD, you will find under 'limitations', a list of the resources used. So (for example), of the PIC18F1330, you lose ROM from 0x1E40 to the end of memory, RAM from 0x0F4 to 0x0FF, and two stack levels.

Best Wishes
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Thu May 26, 2011 9:43 am     Reply with quote

Ttelmah:

Thanks for the reply and yes, I did read that in the data sheet on the 18LF14K22, I just didn't know which microcontroller temtronic was talking about. I assume it about the same for any target.

Regards!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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