Help. There is a need to write data to non-volatile memory, micron. I saw examples, but this is not a bit of what is needed.

Compiler CodeVisionAVR.

An example of a variable that needs to be stored in eeprom and naturally read it.

the question is: are there any functions that can immediately write to the desired cell of the array which is located in the eeprom.

char day_hour_1[36] = /*HOUR*/ { 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22}; 
  • Any EEPROM is more or less limited in terms of the number of rewriting cycles and the time characteristics of the read / write, so it’s common practice to read from there at startup and write at some event ... what functions are there to read / write - see documentation on your compiler. In avr-gcc, this is a eeprom_{read,write}_{byte,word,block} functions. - Fat-Zer

1 answer 1

Problem solved. In CodeVisionAVR it is very simple.

 eeprom char testVar = 5; void main(void){ testVar = 1; //записываем в EEPROM }