Steve Smith wrote 2012-08-11 23:34: > > Guys... > > I have used this form before on an older chip and it worked > > org 2100h > dt 000h,000h,034h,093h,0BEh,0A0h,018h,000h,01Eh,0A4h,055h,008h > dt 01Dh,0DCh,01Dh,014h,01Ch,04Ch,01Bh,084h,01Ah,0BCh,019h,0F4h > It sort of "works" by it's wrong anyway... :-) Having hardcoded addresses in the code makes porting code between models harder. Using the tools in relocatable code is the way to go. The code below works without code changes to the data allocation part on both 16F877(A) and 16F1827 : --------------------------------- deeprom code myeedata dt 000h,000h,034h,093h,0BEh,0A0h,018h,000h,01Eh,0A4h,055h,008h dt 01Dh,0DCh,01Dh,014h,01Ch,04Ch,01Bh,084h,01Ah,0BCh,019h,0F4h --------------------------------- See the LKR files for the definition of "deeprom". By only changing the list/#include lines (and the "Configue"->"Select=20 Device" in MPLAB), it produces an allocation at the correct adresses: F=F6r the 16F887(A) : Symbols - Sorted by Name Name Address Location Storage File --------- --------- --------- --------- --------- MYEEDATA 0x002100 program static D:\...... For the 16F1827 : Symbols - Sorted by Name Name Address Location Storage File --------- --------- --------- --------- --------- MYEEDATA 0x00f000 program static D:\...... And the HEX file(s) is creates accordingly : 16F887A :040000000034003494 :104200000034003434349334BE34A03418340034D1 :104210001E34A434553408341D34DC341D341434B5 :104220001C344C341B3484341A34BC341934F43404 :00000001FF 16F1827: :020000040000FA:020000040000FA :040000000034003494 :020000040001F9 :10E000000034003434349334BE34A0341834003433 :10E010001E34A434553408341D34DC341D34143417 :10E020001C344C341B3484341A34BC341934F43466 :00000001FF > the bit I was > missing was Microchip had moved the memory.... You doesn't *have* to know... :-) You use the symbol MYEEDATA to load the EEPROM address to register EEADRL as usual. Regards, Jan-Erik. > That was on a 877... Now on a pic16f1827 its spitting a linker problem > > MPLINK 4.43, Linker > Device Database Version 1.9 > Copyright (c) 1998-2011 Microchip Technology Inc. > Error - section '.org_3' can not fit the absolute section. Section '.org_= 3' > start=3D0x00002100, length=3D0x00000030 > Errors : 1 > > Link step failed. > > I cant see anything wrong its not too long and the memory is where its > supposed to be > > Anybody any ideas... > > Thanks > Steve > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .