Jump to content

Recommended Posts

Hi there, I have a little problem finding how to initialize eeprom data on my 18F2520.

Something like:

 

#pragma DATA addr, data, data, data, data

 

where addr is the start address and data is the correct initialization data. So my problem is quite simple: What is the right addr for my device? Or, more simply, where can i find doc about that address?

Link to post
Share on other sites

arrigorm,

#pragma DATA addr, data, data, data, data

 

where addr is the start address and data is the correct initialization data. So my problem is quite simple: What is the right addr for my device? Or, more simply, where can i find doc about that address?

 

This information is extremely difficult to find, in fact I can't remember where I found it, and could find it again.

 

Try this:

#pragma DATA 0xF00000, 0x12, 0x34, 0x56, 0x78

 

Regards

Dave

Link to post
Share on other sites

Maybe this will help?

 

From the PIC18FXXXX programming spec DS39622F page 34

 

http://ww1.microchip.com/downloads/en/DeviceDoc/39622F.pdf

 

5.5 Embedding Data EEPROM

 

Information In the HEX File

 

To allow portability of code, a PIC18F2XX0/2X21/

2XX5/4XX0/4X21/4XX5 programmer is required to

read the data EEPROM information from the hex file. If

data EEPROM information is not present, a simple

warning message should be issued. Similarly, when

saving a hex file, all data EEPROM information must be

included. An option to not include the data EEPROM

information may be provided. When embedding data

EEPROM information in the hex file, it should start at

address F00000h.

 

Regards, Teuniz

Link to post
Share on other sites
  • 1 year later...

Something I've missed:

does

0x12, 0x34, 0x56, 0x78
stand for something or it's just an arbitary example?

 

When I label the EEPROM address say:

#pragma DATA _EEPROM, 12, "Mark1"

 

does the labal stand for a the address or for the data? Can I write:

Mark2=Mark1+2

?

Link to post
Share on other sites
Something I've  missed:

does

0x12, 0x34, 0x56, 0x78
stand for something or it's just an arbitary example?
Arbitary data.
When I label the EEPROM address say:

#pragma DATA _EEPROM, 12, "Mark1"

 

does the labal stand for a the address or for the data?

_EEPROM is defined as having a value that correcsponds with the address that will program the target device EEPROM when the program is downloaded. On A PIC16 this address is 0x2007.

 

Can I write:

Mark2=Mark1+2

?

No.
#pragma DATA _EEPROM, 12, "Mark1"

Causes the characters of the string, with a null terminator, to be programmed in EEPROM when the target device is programmed.

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...