|
|
View previous topic :: View next topic |
Author |
Message |
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
EEPROM address in PIC18 |
Posted: Sat Jul 24, 2004 12:05 pm |
|
|
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
|
|
Posted: Sat Jul 24, 2004 12:31 pm |
|
|
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
|
|
Posted: Sat Jul 24, 2004 2:04 pm |
|
|
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
|
|
Posted: Sat Jul 24, 2004 2:15 pm |
|
|
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
|
|
Posted: Sat Jul 24, 2004 3:02 pm |
|
|
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
|
|
Posted: Sun Jul 25, 2004 2:29 am |
|
|
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 |
|
|
|
|
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
|