View previous topic :: View next topic |
Author |
Message |
ckrusen
Joined: 09 Feb 2009 Posts: 12
|
Are EEPROM or RAM included in the output Hex file? |
Posted: Fri Mar 13, 2009 5:42 am |
|
|
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
represent?
I know the following line is the configuration word.
But isn't that supposed to be at 0x2007?
Thanks,
Calvin _________________ Calvin |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Mar 13, 2009 7:48 am |
|
|
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
|
|
Posted: Wed Apr 01, 2009 6:14 am |
|
|
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
|
|
Posted: Wed Apr 01, 2009 6:30 am |
|
|
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
|
|
Posted: Wed Apr 01, 2009 7:38 am |
|
|
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
|
|
Posted: Thu Apr 02, 2009 4:24 am |
|
|
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. |
|
|
|