|
|
View previous topic :: View next topic |
Author |
Message |
KnowMore
Joined: 05 Jul 2010 Posts: 9 Location: Vietnam
|
How to define data-table on on-chip EEPROM |
Posted: Fri Jul 16, 2010 2:55 am |
|
|
I want to define data-table on on-chip EEPROM, and this information will stay in hex file (so it's easy to program chip, and fix it if required).
Does anyone know how can I do?
Thank you! _________________ GOOD TODAY IS ENEMY OF BETTER TOMORROW |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Fri Jul 16, 2010 5:05 am |
|
|
#ROM
You need the 'programming' address of the EEPROM (varies with different chip families 0x2100 on the older PIC16 chips, 0xF00000 on the PIC18, etc. - look at the programming data sheet for this), then:
(on a PIC16)
#ROM 0x2100 = {1,2,3,4,5,6,7,8}
Will put 1 to 8, in the first 8 bytes of the EEPROM.
Best Wishes |
|
|
KnowMore
Joined: 05 Jul 2010 Posts: 9 Location: Vietnam
|
|
Posted: Fri Jul 16, 2010 10:24 am |
|
|
Ttelmah wrote: | #ROM
You need the 'programming' address of the EEPROM (varies with different chip families 0x2100 on the older PIC16 chips, 0xF00000 on the PIC18, etc. - look at the programming data sheet for this), then:
(on a PIC16)
#ROM 0x2100 = {1,2,3,4,5,6,7,8}
Will put 1 to 8, in the first 8 bytes of the EEPROM.
Best Wishes |
Thank you very much! I can do now.
It's seem hard to find EEPROM address from device datasheet, programming specification . I looked for these address at Winpic800 software , and found 0x2100 for PIC12 and 16, 0x780000 for PIC18, 0x7FFC00 for dsPIC30. _________________ GOOD TODAY IS ENEMY OF BETTER TOMORROW |
|
|
KnowMore
Joined: 05 Jul 2010 Posts: 9 Location: Vietnam
|
|
Posted: Fri Jul 16, 2010 10:54 pm |
|
|
I've found that the best way to have EEPROM address of any chip is look in Device Table Editor of our IDE, in tab MCU Parts, middle table, Memory part. _________________ GOOD TODAY IS ENEMY OF BETTER TOMORROW |
|
|
MikeP
Joined: 07 Sep 2003 Posts: 49
|
|
Posted: Sat Jul 17, 2010 2:15 am |
|
|
Code: |
#ROM getenv( "EEPROM_ADDRESS" ) = {1,2,3,4,5,6,7,8}
|
This above will also work and will not need changing if you move to different chip. |
|
|
KnowMore
Joined: 05 Jul 2010 Posts: 9 Location: Vietnam
|
|
Posted: Sat Jul 17, 2010 10:10 am |
|
|
MikeP wrote: | Code: |
#ROM getenv( "EEPROM_ADDRESS" ) = {1,2,3,4,5,6,7,8}
|
This above will also work and will not need changing if you move to different chip. |
Oh! Thank you so much!
Coming here, I find that there are so many things which I don't know about in our IDE. _________________ GOOD TODAY IS ENEMY OF BETTER TOMORROW |
|
|
|
|
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
|