Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] help required abt program memory

2008-03-31 by Tim Mitchell

rakesh modi wrote:
> Hello,
> I want to store my data in program memory, but i can not store. How
> can i store my data in program memory? i have read complete
> instruction manual but i had not found any instruction which stores
> data in program memory. Kit: STK 500  
> Controller: ATMega32
> reply me as fast as possible plz
> 

To change the flash memory from code, you use the spm instruction. You
use lpm to read bytes from the flash memory. Spm and lpm use word
addresses not byte addresses which can cause a bit of fun for the
unwary.

You would not normally store data in program (flash) memory. You would
normally use the eeprom for this.

It is all on page 244 of the Mega32 datasheet.

-- 
Tim Mitchell
tim@sabretechnology.co.uk http://www.sabretechnology.co.uk
Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ
Registered in England and Wales no.3131504
t:01482 801003 f:01482 801078

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.