Discussion in "AVR Discussion Forum" started by    abbas1707    Jan 17, 2008.
Thu Jan 17 2008, 10:17 am
#1
hello everybody!!
i have some confusion...please help

what happens when i do like this

 
char *string_table[] PROGMEM = 
{
    "String 1",
    "String 2",
    "String 3",
    "String 4",
    "String 5"
};


does all the strings in it get stored to program space or data space?? i read some where dat strings here go to data space... but im not getting it :-s
Thu Jan 17 2008, 12:16 pm
#2
store them with keyword "const"
const char....

you have already specified PROGMEM so will go to program memory if you are not getting any compiler error.. check the list file if available..
Wed Jan 23 2008, 01:28 am
#3
Ajay here is some problem
when i do like this
const char *string_table[] PROGMEM = 
{
    "String 1",
    "String 2",
    "String 3",
    "String 4",
    "String 5"
};

after compiling i get from "map" file


*(.progmem*)
.progmem.data 0x00000054 0x4e2 glcdc2.o
0x0000005e font5x8
0x00000054 string_table
0x0000023e font8x8
0x00000536 . = ALIGN (0x2)
0x00000536 __trampolines_start = .


which means it does not store all those strings in program memory.it is just storing that
pointer.
please correct me if im wrong.is there some way to store all strings to program way

Thanx in advance
Wed Jan 23 2008, 10:30 am
#4
while using keil sometimes i use
unsigned char code *string_table[]  =
{
    "String 1",
    "String 2",
    "String 3",
    "String 4",
    "String 5"
};


10 bytes of POINTER data in RAM rest in code section ie. rom

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am