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 support@ccsinfo.com

EEPROM address in PIC18

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



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

EEPROM address in PIC18
PostPosted: Sat Jul 24, 2004 12:05 pm     Reply with quote

Hi guys,
When using the PIC16Fxxx series I use the compiler code:
#rom 0x2100={
128
}
for instance, to preload the EEPROM at program stage.

I'm now using a PIC18F442 and for the life of me I can't find the address of the EEPROM data area to use in the #rom command. I've searched the datasheet!
Can someone please tell me what it is and also where to find it in the data sheet! I've looked in the PIC16Fxxx data sheet for the 0x2100 reference but can't find that either!

Keep well,

Will
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Sat Jul 24, 2004 12:31 pm     Reply with quote

The eeprom address starts at F00000h.
This information is in the programming specs, document 39576b.pdf,
on the microchip website.
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Sat Jul 24, 2004 2:04 pm     Reply with quote

It nearly works!
#rom 0xF00000= {
1,
2,
3,
4,
160
}

Writes 1,0,2,0,3,0,4,0,160,0 into the first 10 EEPROM locations, I was expecting 1,2,3,4,160 into the first five. Am I missing something with the PIC18s?

Will
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Sat Jul 24, 2004 2:15 pm     Reply with quote

I'll answer my own question (it is Saturday night and I've had a pint!)

With the PIC18 you write words in a #rom statment and the increment is 2 EEPROM addresses!
I wish CCS would mention that in their documentation, or make the #rom statment the same as in the PIC16 compilier!

Thanks for your help,

Will
Ttelmah
Guest







PostPosted: Sat Jul 24, 2004 3:02 pm     Reply with quote

Will Reeve wrote:
I'll answer my own question (it is Saturday night and I've had a pint!)

With the PIC18 you write words in a #rom statment and the increment is 2 EEPROM addresses!
I wish CCS would mention that in their documentation, or make the #rom statment the same as in the PIC16 compilier!

Thanks for your help,

Will

You can use it in 'one byte' steps, using:
#ROM int8 0xF00000 = {
1,
2,
3,
4,
160
}

Best Wishes
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Sun Jul 25, 2004 2:29 am     Reply with quote

Superb! I can be lazy and no longer have to convert dec into hex in my head :-) I'm a late convert to the PIC18, snippits of a seminar held over here (in the UK) are coming back to me :-)

Thanks,

Will
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