EEPROM LookUp Table problem with ATMega328
Posted: Fri Mar 18, 2011 5:18 pm
Dear all,
i tried to add an LookUp table (array of 10 bytes) to the eeprom of my ATMega328 within the supplementary code like this:
uint8_t LUT[10] EEMEM = {0,1,2,4,8,12,16,20,50,100}; //Table with 10 data points
I declared an byte array LUT[10] in FlowCode via the variable manager (in C it appears as 'volatile char FCV_LUT[10]' ).
Then I added the following C-code at the top of the main routine to read the EEPROM-data into the LUT[] ram variable :
int i=0;
for(i=0; i <= 9; i++)
FCV_LUT=eeprom_read_byte(&LUT);
Now I displayed all the 10 LUT numbers on my EvaBoard and all values are '255'.
So it doesn't seem that my procedure is working...
Can anbody help?
Many Thanks,
Niro
i tried to add an LookUp table (array of 10 bytes) to the eeprom of my ATMega328 within the supplementary code like this:
uint8_t LUT[10] EEMEM = {0,1,2,4,8,12,16,20,50,100}; //Table with 10 data points
I declared an byte array LUT[10] in FlowCode via the variable manager (in C it appears as 'volatile char FCV_LUT[10]' ).
Then I added the following C-code at the top of the main routine to read the EEPROM-data into the LUT[] ram variable :
int i=0;
for(i=0; i <= 9; i++)
FCV_LUT=eeprom_read_byte(&LUT);
Now I displayed all the 10 LUT numbers on my EvaBoard and all values are '255'.
So it doesn't seem that my procedure is working...
Can anbody help?
Many Thanks,
Niro