gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: EEPROM content in HEX files
From: Craig Franklin
Date: 26 Aug 2003 20:45:05 -0500

On Tue, 2003-08-26 at 04:28, Gabor Kiss [Bitman] wrote:
> Folks,
> 
> While I'm writing Pista, the PICSTART Plus handler program
> (http://gatling.ikk.sztaki.hu/~kissg/pd/pista/pista.html) I found a problem.
> 
> According to Microchip data sheets internal data storage EEPROM
> is addressing starts from 0x0. At least PIC programs and PICSTART Plus
> programmer use this base address.
> This may cause a confusion when handling program code and EEPROM data.
> (It is hard to figure out that address 0x22 belongs code or EEPROM area.)
> 
> However I found that MPLAB exports EEPROM content into HEX files
> with 0x2100 or 0xf00000 base address (depending on 14/16 bit processor
> architecture).
> I guess the same convention is used when it imports HEX files.
> 
> I would like this way of distinguishing program and data address range
> because it would solve a lot of problem but I want to be sure that
> this method is portable.
> So I have some questions, please help!
> 
> 1. Does MPLAB use other than above two base addresses for EEPROM data
> in HEX files?

No, I don't think so.  The addresses are documented in the device
programming datasheets.  If you grep Microchip's linker scripts, all of
the eedata sections are at those two addresses.

> 2. Can Microchip assemblers and compilers produce EEPROM content HEX files?
> Is the base address same as above?

Yes.  mplink uses the above mentioned linker scripts.  If you use mpasm
in absolute mode, the user has to manually specify the same address.

> 3. Do gputils follow this convention?
> 

Yes.

> Thanks.
> 
> Gabor


gnupic@linuxhacker.org