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

Are EEPROM or RAM included in the output Hex file?

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



Joined: 09 Feb 2009
Posts: 12

View user's profile Send private message

Are EEPROM or RAM included in the output Hex file?
PostPosted: Fri Mar 13, 2009 5:42 am     Reply with quote

I would normally think that the HEX file would only include program data, but my HEX files have some data that is specified outside of the 'standard' memory range.

Device is a 16F688, which only has address space from 0x0000.. 0x01ff. My HEX file has the following lines:
Code:
:1000000008308A0000280000FF00030E8301A600CC
<snip>
:101E2000831231100630C8008316C8008A1183124D
:0C1E300019268A1583168312EC28630023
:1042000000000000000000000000000000000000AE
:10421000000000000000000000000000000000009E
:10422000000000000000000000000000000000008E
:10423000000000000000000000000000000000007E
:10424000000000000000000000000000000000006E
:0E425000000000000000000000000000000060
:02400E00F43F7D
:00000001FF
;PIC16F688


What do the lines starting with
Code:
:1042xxx

represent?

I know the following line is the configuration word.
Code:
:02400E00F43F7D


But isn't that supposed to be at 0x2007?

Thanks,

Calvin
_________________
Calvin
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Mar 13, 2009 7:48 am     Reply with quote

Besides the program code some other processor features are sometimes mapped to a memory address and stored in the HEX file. Examples of this are the EEPROM contents, Configuration word, User ID and Calibration Word. RAM is volatile and never included in a HEX file.

For a description of which features are stored in the hex file and at what address locations you'll have to look at the Microchip Memory Programming Specification Manual as published for each chip family. For your chip this will be: http://ww1.microchip.com/downloads/en/DeviceDoc/41204G.pdf
For the PIC16F688 this mentions:
Code:
Program memory:     0x0000 - 0x1FFFF
User ID:            0x2000 - 0x2003
Configuration Word: 0x2007
Calibration word:   0x2008
Data EEPROM:        0x2100 - 0x21FF

Quote:
What do the lines starting with
Code:
:1042xxx

represent?

':' = start code
'10' = number of data bytes in this line; 0x10 = 16 data bytes
''42xx' = four hex digits, a 16-bit address of the beginning of the memory position for the data.
More info at wikipedia

Now the confusing part: The hex file is designed to hold bytes (8-bits) but the addresses in the PIC16 point to 14-bit words. To convert the byte address mentioned in the hex-file to a PIC Word address you have to divide by 2.
So when you divide your mysterious 0x42xx address by two you find it to be in the 0x2100 - 0x21FF EEPROM range.
AsmallGuy
Guest







PostPosted: Wed Apr 01, 2009 6:14 am     Reply with quote

Is there any other place where i can read where the EEPROM locations are for a specific PIC? it's strange that they are not reported on the device datasheet.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Apr 01, 2009 6:30 am     Reply with quote

I guess, you didn't read the datasheet thoroughly. Part of the information actually is shown in any Microchip datasheet, e.g. the said configuration word at 2007h.
Ttelmah
Guest







PostPosted: Wed Apr 01, 2009 7:38 am     Reply with quote

The EEPROM locations, are in the 'programming' sheet for the whole family, rather than in the individual data sheets. 0x2100, for all 16 chips 0xF00000 for all 18 devices.

Best Wishes
AsmallGuy
Guest







PostPosted: Thu Apr 02, 2009 4:24 am     Reply with quote

Ttelmah wrote:
The EEPROM locations, are in the 'programming' sheet for the whole family, rather than in the individual data sheets. 0x2100, for all 16 chips 0xF00000 for all 18 devices.

Best Wishes


Got it! thanks ;)

About the datasheet for individual parts: if you open it, hit "ctrl+F" and search for "2100" i get only a phone number with such sequence, also tryed "21" but nothing about EEPROM numbers.. instead in the programming spec PDF i'm able to find it immediately.
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