View previous topic :: View next topic |
Author |
Message |
JerryR
Joined: 07 Feb 2008 Posts: 167
|
PIC18F14K22 can't debug |
Posted: Tue May 24, 2011 6:14 pm |
|
|
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 I've surf the forum and find nothing that seems to suggest a fix here.
Sorry, getting pretty frustrated. But, thanks for any help! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
JerryR
Joined: 07 Feb 2008 Posts: 167
|
|
Posted: Wed May 25, 2011 5:29 am |
|
|
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
|
|
Posted: Wed May 25, 2011 5:35 am |
|
|
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
|
SOLVED. THANKS PCM |
Posted: Wed May 25, 2011 4:26 pm |
|
|
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
|
|
Posted: Wed May 25, 2011 4:54 pm |
|
|
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
|
|
Posted: Thu May 26, 2011 5:06 am |
|
|
Super information, I'll give that a try. I'm assuming that that DEBUG/RELEASE control the /BKBUG bit in CONFIG4 register.
Thanks again. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Thu May 26, 2011 5:43 am |
|
|
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
|
|
Posted: Thu May 26, 2011 6:25 am |
|
|
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
|
|
Posted: Thu May 26, 2011 9:24 am |
|
|
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
|
|
Posted: Thu May 26, 2011 9:43 am |
|
|
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! |
|
|
|