Programming EEPROM (ATMega1284P)

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, all -

 

I'm trying to load a file into the on-chip EEPROM. I've tried using bin and hex files.

 

AS7 -> Tools -> Device Programming -> "Program". Says it works, verify confirms it. But when I read, the contents of EEPROM are unchanged.

 

Any idea what I'm doing wrong?

 

Thanks.

M. Zimmers
Cyberdata

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mzimmers wrote:
Says it works,

So, what tool does that invoke to do the ISP?  [I'm not an expert Studio7 user]  Is there a detailed log of the commands that do the ISP?  Can you make it as "verbose" as practical for this exercise?

 

Does the command to do the ISP call out doing EEPROM as well as flash?  Is the .EEP file created, or perhaps part of .ELF?  What file does the log show is being opened and transmitted to do the EEPROM programming?   What are the verification results?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mzimmers wrote:

But when I read, the contents of EEPROM are unchanged.

Tell more about the readback.  "Unchanged" from what?  The erased state, all 0xff?

 

If not, what is the state of the EESAVE fuse?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It turns out the logger is already quite verbose - nearly 500K bytes of text from one attempt at programming and verifying the EEPROM!

 

Not sure I know what you mean by "what tool" -- it's an Atmel AVRISP mkII, if that's what you mean.

 

When I read, I create the .eep file. I have tried to load a hex and a bin file; both cause AS to claim the memory is changed, but it's not. It's the same as it was before I tried to program it.

 

Hard to read everything in the log file, but I've found no indication of an error.

 

EDIT:

 

One other data point: this feature (programming memories) works in AS 4, with the same .hex file I'm trying to use now, so either they introduced a bug (unlikely) or it's a setup issue of some kind.

M. Zimmers
Cyberdata

Last Edited: Wed. Dec 6, 2017 - 09:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

preserve EEPROM bit set in your programming options?

In that case it will do nothing with the EEPROM.

 

in AS7,

hover over the project and right click:

Then select properties and then in the "tool" tab there is a checkbox "Preserve EEPROM":

 

IIRC if that is set the EEPRom will not be written what ever you do.

 

note that there also is potentially a preserve eeprom flag in the fuse bits that you might need to clear:

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Second vote for EESAVE. Depending on the order you program things it could be that the data you put into the EEPROM is simply erased by the next programming of the Flash as "Chip Erase" erases both Flash and EEPROM unless EESAVE is activated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mzimmers wrote:
It turns out the logger is already quite verbose - nearly 500K bytes of text from one attempt at programming and verifying the EEPROM!

And you choose to share none of it with us?  I'm out.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.