User Tools

Site Tools


info:reading_thermistor_tables_with_gcc

This is an old revision of the document!


Thermistor tables

GCC access of program memory space isn't as transparent as other compilers. You need to use the pgm_read_word command, as stated in the AVRLibC manual (see page 19 of the latest one). Example (untested):

Code:
#include <avr/io.h>
#include <avr/progmem.h>
int thermistor[] PROGMEM = { 653, 545…-94,-107}; there are 1024 values
int thermistor_f (int adc)
{
return(pgm_read_word(&thermistor[adc]));
}

info/reading_thermistor_tables_with_gcc.1233275565.txt.gz · Last modified: 2009/01/29 19:32 by tomgee