CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to define data-table on on-chip EEPROM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
KnowMore



Joined: 05 Jul 2010
Posts: 9
Location: Vietnam

View user's profile Send private message

How to define data-table on on-chip EEPROM
PostPosted: Fri Jul 16, 2010 2:55 am     Reply with quote

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: 19504

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 5:05 am     Reply with quote

#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

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 10:24 am     Reply with quote

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 Sad . I looked for these address at Winpic800 software Very Happy , 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

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 10:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 17, 2010 2:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 17, 2010 10:10 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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