Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » AVR-GCC
  • » [avr-gcc-list] how to write specific value to program memory? [RSS Feed]

#1 Nov. 24, 2005 14:05:22

임.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] how to write specific value to program memory?


hi, I am using atmega128 mic.i want program memory to store data, not eeprom.At avrlibc, the file of pgmspace.h provide the function
to read the program memory.But I can't find the function to write the program
memory.how to write specific value to program memory? Thank you._______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Nov. 24, 2005 17:37:52

David K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] how to write specific value to program memory?


On Nov 24, 2005, at 6:49 AM, 임지수 wrote:hi,

I am using atmega128 mic.
i want program memory to store data, not eeprom.At avrlibc, the file of pgmspace.h provide the function to read theprogram memory.But I can't find the function to write the program memory.
how to write specific value to program memory?Its hard to write to FLASH program memory so its not done very oftenother than to write executable code and constant data. Also ingeneral FLASH memory can not be reprogrammed as many times beforebreaking than EEPROM cells.EEPROM is much easier to write but harder to read than FLASH becausethe AVR EEPROM is not in either of the CPU memory spaces. Thesolution I use for read-often variables is to declare a structurecontaining all my EEPROM variables. Then create two allocations ofthat structure, one in RAM and one in EEPROM. Usually call them eeand wc, for EEprom and Working Copy, that its obvious ee.calibrationand wc.calibration are paired.Initialization is easy because one only has to bulk copy ee into wc.Is also practical to bulk copy wc into ee, but I selectively write myupdates as needed.--
David Kelly N4HHE,
========================================================================
Whom computers would destroy, they must first drive mad.





_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Nov. 25, 2005 18:03:23

Kevin N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] how to write specific value to program memory?


On Thu, 24 Nov 2005, David Kelly wrote:

>
> On Nov 24, 2005, at 6:49 AM, 임지수 wrote:
>
> > hi,
> >
> > I am using atmega128 mic.
> > i want program memory to store data, not eeprom.
> > At avrlibc, the file of pgmspace.h provide the function to read the
> > program memory.
> > But I can't find the function to write the program memory.
> > how to write specific value to program memory?
>
> Its hard to write to FLASH program memory so its not done very often
> other than to write executable code and constant data. Also in
> general FLASH memory can not be reprogrammed as many times before
> breaking than EEPROM cells.
>
> EEPROM is much easier to write but harder to read than FLASH because
> the AVR EEPROM is not in either of the CPU memory spaces. The
> solution I use for read-often variables is to declare a structure
> containing all my EEPROM variables. Then create two allocations of
> that structure, one in RAM and one in EEPROM. Usually call them ee
> and wc, for EEprom and Working Copy, that its obvious ee.calibration
> and wc.calibration are paired.

For large amounts of read-often data, you might consider keeping two
copies in EEPROM. I have a factory default copy and a user-modified
copy. It's an alternative for systems where RAM is limited and
access to the constant can be slow; it works well for embedded systems
that are connected to mechanical devices.

--Kevin Neff




_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

  • Root
  • » AVR-GCC
  • » [avr-gcc-list] how to write specific value to program memory? [RSS Feed]

Board footer

Moderator control

Enjoy the 22nd of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support