Flash variables

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

Hi guy's

I'm after some more variable space, for a few arrays of say 50 bytes. I've no SRAM left, and the design is such that I can no longer use an external piece of memory.

The variables are not accessed very often, and it doesn't matter if there is a bit of latency when reading/writing them.

I was therefore thinking that maybe I could nip out to a boot code and retrieve or program space in flash that would be my variables.

I am using an ATMEGA16. I have seen some code from the files section of the Codevision AVR yahoo groups, but was just wondering if anyone has implimented changing flash in a program already?

Cheers, Brian.

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

Can you not store them in the EEprom as it will take a lot more 'hits' than the flash?

admin's test signature
 

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

No, I have no space in the EEPROM, I realise re-writability (think I just invented that word!) will be an issue, but these variables won't change very often, just wondered if anyone had done anything similar with changing values in flash..

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

Yes, it will have been done by lots. You read the page in from the flash to the spm buffer register change the require bits then write back.

But could you change some the variables into flags in some way so saving space or even reducing down so they use a nibble rather than a byte.
Mike

Keep it simple it will not bite as hard