Jump to content

Recommended Posts

hi,

 

I have used #pragma DATA _EEPROM, 99, 99, 99 successfully on a 12F device, but im now using a 16F1827, and MPLAB appears to not reconise the eeprom data?

 

Can someone that knows hex files have a look to check this feature is working ?

 

 

 

Thanks! :rolleyes:

Share this post


Link to post
Share on other sites
hi,

 

I have used #pragma DATA _EEPROM, 99, 99, 99 successfully on a 12F device, but im now using a 16F1827, and MPLAB appears to not reconise the eeprom data?

 

Can someone that knows hex files have a look to check this feature is working ?

 

 

 

Thanks! :rolleyes:

 

Microchip document DS41390C defines the physical address range for EEPROM on the 16F1827 as 0x1E000 to 0x1E1FF. SourceBoost PIC16F1827.h defines _EEPROM as 0x1E000 so all would appear to be well but as you point out it doesn't seem to work in MPLAB. However, changing the definition in PIC16F1827.h to 0xf000 seems to allow it to work in MPLAB. Not sure whether it works on a real device though!

 

davidb

Share this post


Link to post
Share on other sites

Hi,

 

Yes that works, i programmed he device, then read back the eeprom and it is correct.

 

How strange. Any idea why MPLAB ignores the correct address? Where did 0xf000 come from?

Share this post


Link to post
Share on other sites
Hi,

 

Yes that works, i programmed he device, then read back the eeprom and it is correct.

 

How strange. Any idea why MPLAB ignores the correct address? Where did 0xf000 come from?

 

In case you don't know where to find it (once I spent a long time looking in the devices data sheet and it's not in there) , you can find the address that needs to used when programming the target device and wanting to write to EEPROM as part of this process in the devices "Memory Programming Specification" data sheet from Microchip.

 

BTW: I know this doesn't help with the 0xf000 address question.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Hi Guys,

 

Could it be the internal address space of the PIC is only 16 bits (0000-ffff). Therefore 1e000 cannot exist in the device but only in the hex file. I think the 1e000 is shifted to f000 internally when programming.

 

If you are debugging using MPLAB then you only see the 64k address space therefore the EEPROM must be at f000.

 

Does this sound logical ?

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites
Hi,

 

Yes that works, i programmed he device, then read back the eeprom and it is correct.

 

How strange. Any idea why MPLAB ignores the correct address? Where did 0xf000 come from?

 

In case you don't know where to find it (once I spent a long time looking in the devices data sheet and it's not in there) , you can find the address that needs to used when programming the target device and wanting to write to EEPROM as part of this process in the devices "Memory Programming Specification" data sheet from Microchip.

 

BTW: I know this doesn't help with the 0xf000 address question.

 

Regards

Dave

Dave,

 

The specification states that:

 

The physical address range of the 256 byte data

memory is 0000h-00FFh. However, these addresses

are logically mapped to address 1E000h-1E1FFh in the

hex file. This provides a way of differentiating between

the data and program memory locations in this range.

The format for data memory storage is one data byte

per address location, LSb aligned.

 

Note that it says mapped to the HEX file address.

The hex file uses double bytes so the range 1E000h-1E1FFh gives 512 bytes for 256 bytes of EEPROM.

Halving the hex address gives us F000 - F0FF which appears to be correct.

 

davidb

Share this post


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...