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

problem with #ID and hex file

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



Joined: 22 Feb 2012
Posts: 4

View user's profile Send private message

problem with #ID and hex file
PostPosted: Wed Feb 22, 2012 2:10 am     Reply with quote

I am writing code for a PIC18F458, using compiler PCH 4.005 (running under Microchip IDE v8.46).

Ok, so I'm trying to use the #ID command to load some data. Easy enough. In my code I have something like:
Code:
#ID  0xABCD

But here's the final few lines from the generated hex file:
Code:
:020000040030CA
:0E00000000220C0F000081000FC00FE00F4027
:020000040000FA
:082000000A000B000C000D00AA
:00000001FF
;PIC18F458

Ok, first line jumps to far address 0x30 0000, and the second line programs my configuration bits. Good so far. Now for the ID bytes...

Third line...jumps back to 0x00 0000. Fourth line, stores my ID values at address 0x00 2000.

Um...am I missing something? Shouldn't the ID values be shoved into address 0x20 0000? I did some searching on the board for any other mention of this and didn't find one, so maybe I'm just reading this wrong(?).

(Actually I also tried this with the PIC18 compiler under MPLABX, and the hex file does indeed put the ID data at 0x20 0000. Whacky.)

Has this issue been found/addressed before? Is there a work-around (other than editing the hex file outside of the compiler)?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Wed Feb 22, 2012 3:26 am     Reply with quote

You are reading it wrong.
Look up extended Intel Hex addressing.
An address _offset_ is being applied. The line addresses are not absolute.

However I'd not hold much hope of being able to get code to work with 4.005. This was an 'alpha' release version at best. Several dozens of versions before the first V4 compiler that has a chance of generating any reasonable code...

Best Wishes
DrDoug



Joined: 22 Feb 2012
Posts: 4

View user's profile Send private message

PostPosted: Wed Feb 22, 2012 10:59 am     Reply with quote

Hmmm. I actually don't see how I'm reading this wrong. Sure, the line addresses are offsets; they're offsets from the previous extended address command. ID locations start at 0x20 0000. This code is trying to put the ID data at 0x00 2000. The hex file is just plain wrong.

But, since you mentioned it, I did realize I was not using my latest compiler version (v4.005 was located at c:\program files\PICC, but I have v4.090 installed under ...\Microchip\Third party\PICC). I recompiled under v4.090, and now the hex file is generated correctly. Heh, gotta watch those toolsuite paths.

Thanks for the help.
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