Jump to content
Sign in to follow this  
don_erickson

Ide 5.7 Problem

Recommended Posts

IDE 5.7, using the debugger, shows "00" for all unprogrammed eeprom locations. It should be "FF". Something in my program is over-writing one location with a "00", and I can't use the debugger to find out what is doing that, since I won't be able to to see the change.

 

Thanks

don

Share this post


Link to post
Share on other sites

Don,

 

I guess the EPROM state will all be FF when the chip comes from the factory, after that point its what ever was last written.

 

Anyway you can inititialise the whole thing yourself when you program is downloaded to the device, or when you open it in the debugger.

 

Add this to your PIC16 program:

 

#pragma DATA, 0x2100, 0xFF,0xFF,0xFF,0xFF,0xFF.....

 

EEPROM is mapped to 0x2100 to 0x21FF when the device is programmed.

 

Regards

Dave

Share this post


Link to post
Share on other sites

My problem is that the debugger says that these unprogrammed locations consist of "00", when in fact they consist of "FF". I can read the contents of the EEPROM with my programmer, and can confirm that they are "FF". But when the debugger says they are "00", I can't tell what is changing one particular location to "00".

 

don

Share this post


Link to post
Share on other sites

Don

 

Add this you code:

#pragma DATA, 0x2100, 0xFF,0xFF,0xFF,0xFF,0xFF.....

 

and Build it.

And then when you open program in debugger the locations will be initially set to 0xFF.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Don,

 

Oh -- OK, I see now. We can trick the debugger into seeing reality.

 

Its not fooling the debugger/simulator at all.

 

Its specifying initialisation data for the EEPROM, this works with the simulator or the actual device.

 

For example if you want to store a constant string in EEPROM and program it in there when you program the chip:

 

#pragma DATA 0x2100, "string to store in EEPROM"

 

This gets programmed into EEPROM when you program the PIC.

Nothing is done when the code actually runs.

 

Hope that makes it clear.

 

Regards

Dave

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...
Sign in to follow this  

×
×
  • Create New...