Gents,
First, I am using AVR Studio 6.2.1153 (latest release as of this post) that is fully updated (just forced a check for updates this evening). The program compiles as I would expect, but the data files do not appear to be written correctly. This is what I am trying to do:
So I have a small table I want to put into eeprom, like so:
const uint16_t ADC_temperature_table[] PROGMEM = { 0x13, 0x16, 0x18, 0x1B,0x1F, 0x22, 0x26, 0x2B, 0x2F, 0x34, 0x3A, 0x40, 0x46, 0x4D, 0x55, 0x5D, 0x65, 0x6E, 0x78, 0x82, 0x8D, 0x98, 0xA4, 0xB0, 0xBE, 0xCB, 0xD9, 0xE8, 0xF7, 0x106, 0x116, 0x127, 0x137, 0x148, 0x15A, 0x16B, 0x17D, 0x18E, 0x1A0, 0x1B2, 0x1C4, 0x1D5, 0x1E7, 0x1F8, 0x20A, 0x21B, 0x22B, 0x23C, 0x24C, 0x25C, 0x26B, 0x27B, 0x289, 0x298, 0x2A5, 0x2B3, 0x2C0, 0x2CD, 0x2D9, 0x2E5, 0x2F0, 0x2FB, 0x305, 0x310, 0x31A, 0x323, 0x32C, 0x335, 0x33D, 0x345, 0x34C, 0x354, 0x35B, 0x361, 0x368, 0x36E, 0x374, 0x37A, 0x37F, 0x384, 0x389, 0x38D, 0x392, 0x396, 0x39A, 0x39E, 0x3A2, 0x3A6, 0x3A9, 0x3AC, 0x3AF, 0x3B2, 0x3B5, 0x3B8, 0x3BB, 0x3BD, 0x3C0, 0x3C2, 0x3C4, 0x3C6, 0x3C8, 0x3CA, 0x3CC, 0x3CE, 0x3D0, 0x3D1, 0x3D3, 0x3D4, 0x3D6, 0x3D7, 0x3D9 };
I have these header files:
#include#include #include #include "main.h"
(main.h has the table in it)
And I am reading the data like so:
test = pgm_read_word(&ADC_temperature_table[i]);
The problem is when the program is compile, it only writes 14 bytes to the .eep file:
:00000001FF
Either that is NOT the correct EEPROM file (but it does fit the size of the data memory usage of 14 bytes), or I have something screwed up. Again.
My (limited) understanding of using the program memory is that when the "PROGMEM" keyword is used, the linker puts the data into the EEPROM data file instead of the flash memory file. But that does not appear to be what is going on here.
What am I doing wrong?