Olin Lathrop wrote: > > Another thing (yes, this is my first try with the EEPROM !), > > I'v seen in the HEX file that each other byte (?) is "00". > > That is, when I create the data with DE directive, they seems to > > be either 16-bit values, or there is something "going on" > > with the addresses in the hex file. *And* the addresses > > in the HEX file are actualy h'4002' when I expected h'2001'. > There are two different things going on, depending on which PIC you are > using. 16F629 > On the 16 family, each program memory address is a 14 bit word. > Intel HEX files are inherently byte oriented, so microchip uses two > addresses in the HEX file for each PIC program memory address. The HEX > file addresses are therefore double the PIC program memory addresses. > On the 18 family, each program memory address is an 8 bit byte so these > map to HEX file addresses directly. However, the DE directive always > allocates an entire instruction word for each data byte, so we're back to > two addresses per EEPROM byte in the HEX file, but for different reasons. > This is also a pain in the source code because not only are all the EEPROM > addresses offset by where in the HEX file they decided to map the separate > EEPROM address space to (PICs actually have 3 completely independent > address spaces: data RAM, program memory, and EEPROM), but the offsets > within the EEPROM address range are doubled. Yes, I think this sucks too. > EEPROM should really be dealt with natively in the assembler and linker. Well, I'll try to program my HEX file and write some EEPROM-read- code and see what it finds on the different EEPROM addresses. My hex file looks like this (end of it): :02400E00843FED [Config setings, right?] :10420000FF00FC00FA00F700F500F300F000EE00FC :10421000EC00E900E700E500E200E000DE00DB0082 :10422000D900D700D400D200D000CD00CB00C90007 :10423000C600C400C200BF00BD00BB00B800B6008D :10424000B400B100AF00AC00AA00A800A500A30014 :10425000A1009E009C009A0097009500930090009A :104260008E008C00890087008500820080007E001F :104270007B00790077007400720070006D006B00A5 :024280006900D3 :00000001FF I supose "4200" in line two, is the EEPROM address "2100". And I should worry about the extra "00" between each of my values (which are "FF", "FC", "FA", "F7" and so on), right ? Jan-Erik. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics