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 support@ccsinfo.com

Can ICD2 be used to in Debug Mode on 18F24J10 ?

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



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

Can ICD2 be used to in Debug Mode on 18F24J10 ?
PostPosted: Fri Oct 31, 2008 9:51 am     Reply with quote

I have an 18F24J10 part hooked upto my ICD2. I am using a 10mHz xtal, MPLAB 8.10 and PCH 3.249.

to solve the fuse bug in 3.249 I am setting fuses with
Code:
#fuses PRIMARY,H4_SW,NOIESO,NOXINST,NOWDT,NOPROTECT,NOFCMEN,CCP2B3,NODEBUG
#rom 0x1FFF8 = {0x04A0,0x0F05,0x02F8}


Should I be able to debug at full speed ? ie 40mHz with the PLL on.

I find I can debug only upto the point where I issue the
Code:
setup_oscillator(OSC_PLL_ON) ;

If I comment the above line out it seems to debug Ok through the rest of the code, however this is only at 10 not 40mHz.

Also for some reason if turn on the +ICD flag in the project options CCS complains that the part does not support ICD !! Even though it can !
Quote:
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "Fader5a.c" +DF +LN +T +A +M -Z +ICD +Y=9 +EA
*** Error 164 "N:\Projects\CityNeon\NewStreetSquare\NusoftController\Demo01\Fader5a\18F24J10.h" Line 2(9,20): Selected part does not have ICD debug capability
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 31, 2008 12:25 pm     Reply with quote

When I compile your #fuses and #rom settings with vs. 4.081, I get this
data at the end of the .LST file:
Code:
Configuration Fuses:
   Word  1: F400   DEBUG NOXINST NOSTVREN NOWDT NOPROTECT RESERVED
   Word  2: FF05   H4_SW WDT32768 NOFCMEN NOIESO PRIMARY RESERVED
   Word  3: F000   CCP2B3 RESERVED

ROM data:
01FFF8: A0 04 05 0F F8 02

Your ROM data does not match your intended fuse settings. I'm assuming
that you would like the ROM data to match the fuses generated by
a presumably good version of the compiler (4.081), but they don't.
For example, your ROM settings for Word 1 disable the DEBUG fuse.
Here is a comparison:
Code:

Register  CCS   Your settings
Config1L  00    A0
Config1H  F4    04
Config2L  05    05
Config2H  FF    0F
Config3L  00    F8
Config4H  F0    02

Refer to Table 20-1 in the 18F24J10 data sheet for an explanation of
the Config bits. It's on page 232 in the Acrobat Reader.
Quote:
TABLE 20-1: CONFIGURATION BITS AND DEVICE IDs
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Sat Nov 01, 2008 4:14 am     Reply with quote

Dear PCM

My question was realy about why I could'nt use ICD2 to debug past switching the PLL on and why CCS complains about +ICD compiler switch.

I think your focus on the fuses may be a red herring as I discuss below. I have tried with and without the manually setting the debug fuse bit. (I changed the #ROM as well !)
Code:
// My Debug Fuse Settings
#fuses PRIMARY,H4_SW,NOIESO,NOXINST,NOWDT,NOPROTECT,NOFCMEN,CCP2B3,DEBUG
#rom 0x1FFF8 = {0x0420,0x0F05,0x02F8}

Configuration Fuses:
   Word  1: 0420   DEBUG NOXINST STVREN NOWDT NOPROTECT
   Word  2: 0F05   H4_SW WDT32768 NOFCMEN NOIESO PRIMARY
   Word  3: 02F8   CCP2B3


I am still using PCH 3.249. I know v4 is probably a lot better than it was year ago. However I am sure there are plenty of threads exploring that issue.

I note the following discrepancies with your analysis of comparing the config produced by my PCH 3.249 and your PCH 4.081.

In my PCH 3.249 I had the following :

Quote:
#fuses PRIMARY,H4_SW,NOIESO,NOXINST,NOWDT,NOPROTECT,NOFCMEN,CCP2B3,NODEBUG
#rom 0x1FFF8 = {0x04A0,0x0F05,0x02F8}

Produces in .LST
Configuration Fuses:
Word 1: 04A0 NODEBUG NOXINST STVREN NOWDT NOPROTECT
Word 2: 0F05 H4_SW WDT32768 NOFCMEN NOIESO PRIMARY
Word 3: 02F8 CCP2B3


Note the differences you have that I have highlighted for you.
Quote:
Configuration Fuses:
Word 1: F400 DEBUG NOXINST NOSTVREN NOWDT NOPROTECT RESERVED - Only BIT 2 of CONFIG1H is a fuse, other bits just ensure a NOP
Word 2: FF05 H4_SW WDT32768 NOFCMEN NOIESO PRIMARY RESERVED - BITS 4-7 of CONFIG2H are not fuses, bits just ensure a NOP
Word 3: F000 CCP2B3 RESERVED - Only BIT 0 of CONFIG3H is a fuse, others just used to ensure NOP

ROM data:
01FFF8: A0 04 05 0F F8 02


In summary it seems you have used DEBUG instead of NODEBUG and NOSTVREN instead of STVREN. Also 3.249 does not seem to care about setting the unused bits so the config words will look like NOP instuctions, should your code go to places it shouldn't. PCH 4.081 seems to have fixed this and does set the NOP bits
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Nov 01, 2008 8:48 am     Reply with quote

Here's a similar problem, as reported in the Microchip ICD2 forum:
http://forum.microchip.com/tm.aspx?m=357884

I suggest that you post your problem in that forum:
http://forum.microchip.com/tt.aspx?forumid=49
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Nov 01, 2008 10:41 am     Reply with quote

According to the quoted support statement, the problem should be fixed now in MPLAB V8.15. Did you try?
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Sat Nov 01, 2008 10:51 am     Reply with quote

No I didn't. I did look at the release notes for 8.15 but I did not see anything that looked to me like a "we fixed that PLL problem". However it can't do any harm to try it.
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Sun Nov 02, 2008 3:42 am     Reply with quote

Very Happy A nice Guy called Ken has put some new ICD2 firmware executives on the Microchip forum. These fix the "Can't get past PLL on instruction" when debugging on the 18F24J10 & with the 18F45K20 & 18F46K20 chips.

The great thing is you don't need to re-install a 8.15 version of MPLAB, just put the firmware files in the ICD2 directory of your PC.

I am now able to debug the 18F24J10 at full speed.

See this thread to get the downloads http://forum.microchip.com/tm.aspx?m=357884
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