Go Down

Topic: strange behavior on my prog ! (Read 2 times) previous topic - next topic

Massimo Banzi

Eric


can you try this code??

Code: [Select]


const char *sNomJour[7]   __attribute__((section(".eeprom"))) = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};

void setup() {
beginSerial(9600);
}


void loop() {


  printString(sNomJour[2]);


}





not sure it's going to work but I forced the program to store the array in the eeprom

can you try this technique with your code?

see if it solves the problem

massimo




mrbbp

i've tried this :
Code: [Select]
const char *sNomJour[7] = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};
const char *sJour[33]   __attribute__((section(".eeprom"))) = {"", " premier", " deux", " trois", " quatre", " cinq", " six", " sept", " huit", " neuf", " dix", " onze", " douze", " treize", " quatorze", " quinze", " seize", " dix-sept", " dix-huit", " dix-neuf", " vingt", " vingt-et-un", " vingt-deux", " vingt-trois", " vingt-quatre", " vingt-cinq", " vingt-six", " vingt-sept", " vingt-huit", " vingt-neuf", " trente", " trente-et-un", " mille"};
const char *sMois[13] = {"", " janvier", " fevrier", " mars", " avril", " mai", " juin", " juillet", " aout", " septembre", " octobre", " novembre", " decembre"};
const char *sAnnee[8] = {"", ""," deux mille deux", " deux mille trois", " deux mille quatre", " deux mille cinq", " deux mille six"};

and have as result
Quote
mercrediü fevrierüü
jeudir fevrierüü
vendredi¨ fevrierüü
samedi fevrierüü
dimanche fevrierüü


i've tried this :
Code: [Select]
const char *sNomJour[7] __attribute__((section(".eeprom"))) = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};
const char *sJour[33] = {"", " premier", " deux", " trois", " quatre", " cinq", " six", " sept", " huit", " neuf", " dix", " onze", " douze", " treize", " quatorze", " quinze", " seize", " dix-sept", " dix-huit", " dix-neuf", " vingt", " vingt-et-un", " vingt-deux", " vingt-trois", " vingt-quatre", " vingt-cinq", " vingt-six", " vingt-sept", " vingt-huit", " vingt-neuf", " trente", " trente-et-un", " mille"};
const char *sMois[13] = {"", " janvier", " fevrier", " mars", " avril", " mai", " juin", " juillet", " aout", " septembre", " octobre", " novembre", " decembre"};
const char *sAnnee[8] = {"", ""," deux mille deux", " deux mille trois", " deux mille quatre", " deux mille cinq", " deux mille six"};


result :
Quote
ç dix-sept fevrier deux mille deux
t dix-huit fevrier deux mille deux
ü dix-neuf fevrier deux mille deux
vingt fevrier deux mille deux
vingt-et-un fevrier deux mille deux


i think this not the good solution :'(

regards

eric

kuuk

#12
Apr 15, 2006, 12:59 am Last Edit: Apr 15, 2006, 01:01 am by leKuk Reason: 1
i can't get it work neither.

Code: [Select]
const char *sNomJour[7]   __attribute__((section(".eeprom"))) = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};
i don't think that this line writes anything to eeprom

i read out the eeprom in the main loop function afterwards but it always showed the values that i put there the run before.
Code: [Select]

      int EEadr;
     
     for ( EEadr=0;  EEadr<512;  EEadr++){

       value1 = eeprom_read_byte(EEadr);

       printInteger(EEadr);
       printByte(62); //">"
       printHex(value1);
       
       printNewline();
    // eeprom_write_byte(EEadr,0xDD); //uncommented in the second run
     }

is giving out 0xDD for all addresses.  :-/

mrbbp

#13
May 04, 2006, 11:49 pm Last Edit: May 04, 2006, 11:50 pm by mrbbp Reason: 1
hello,

i've find in avrfreak forum a thread about how to put cosntant in flash...

http://www.avrfreaks.com/index.php?name=PNphpBB2&file=viewtopic&t=36339&highlight=enough+ram+var&sid=ac0aaea81038b29246ff1a3bb17834a7

but i'm not sure to understand with my poor knowledge... :-[ do you think it works ?
and what code do the trick :-/

sorry...
any help will be cool... :-*

eric

Go Up