For example, there is an array:

unsigned int tabz[] = {64, 128, 256, 512, 1024, 2048, 4096}; 

In CodeVisionAVR, to place this array in flash, you need to write this:

 flash unsigned int tabz[] = {64, 128, 256, 512, 1024, 2048, 4096}; 

In Atmel Studio 6 is impossible. How to place an array in flash memory in Atmel Studio 6?

    2 answers 2

    For flash memory, you must declare as follows:

     const unsigned char Scena[4] PROGMEM = {1,2,3,4} 

    Be sure to specify const , otherwise it shoves in RAM!

      Example for avr gnu:

       #include <avr/io.h> #include <avr/pgmspace.h> uint8_t string[12] PROGMEM = {"hello world!"}; int main(void) { UDR0 = pgm_read_byte(&string[10]); }