[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Placing constants at known locations in eeprom at co
From: |
Klaus Rudolph |
Subject: |
Re: [avr-gcc-list] Placing constants at known locations in eeprom at compile time |
Date: |
Fri, 30 May 2003 08:08:06 +0200 |
Hi David,
>
> I have a requirement to place constants in the EEPROM of an ATmega323 in
> known locations at compile time.
I use the following code in my project:
<code>
//******************************************************************
//* EEProm Positionen *
//******************************************************************
.section .eeprom
CONTROLLER_ID_LOW:
.byte 0x80 ;defaultadresse
CONTROLLER_ID_HIGH:
.byte 0x40 ;defaultadresse
//now we need a gap, so that all!!! informations stand whitin one page!
//of the eeprom!
.rept 64-2
.byte 0x00
.endr
#define DAUERANDGROUP_LEN 8*ANZ_BANK
DAUERANDGROUP0:
.rept ANZ_BANK
.rept 4
.byte 0x30+0x02, 0x00 ;dauer Bit7..3, Gruppe Bit2..0 (3Bit)
.endr
.endr
<\endcode>
It make no difference between writing data to flash than
to eeprom. Only difference is to use the .eeprom section here.
Hope that helps
Bye
Klaus