[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Using flash memory for storing large look up tables

From: dhananjay deshpande
Subject: [avr-gcc-list] Using flash memory for storing large look up tables
Date: Tue, 24 Jan 2006 07:16:08 +0000 (GMT)

I am learning to use AVRGCC. I am using it in AVRSTUDIO.
I have a difficulty for my application of "sunset switch on- sunrise switch off relay", which requires a look up table of ~730 integers to be stored in the program. I do not have any other option but to save this table in program memory.
I am using ATMEGA 8535L, I am using assynchronous timer and external 32kHz crystal for realtime keeping.
Question is how to store and retrieve the table contents.
I started with a little short table of 2 months timing for sunset and sunrise.
the code was as follows
for storing the sunset and sunrise timings
const int __attribute__((section(".text"))) sunrise[2][31]={
       ,{                                         }
const int __attribute__((section(".text"))) sunset[2][31]= {
         {          }                  };
for retrieving
todayssunset=sunset[t.month][t.date] ;  //t is a structure .
This retrieving doesnot work if I use __attribute__((section(".text"))).
If I do not use section(".text") attribute, the table is stored in data space which is insufficient . Is there any way out?  please help.
Thanks in advance     

Send instant messages to your online friends http://in.messenger.yahoo.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]