User Tools

Site Tools


info:reading_thermistor_tables_with_gcc

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]));
}
There are many circuits and measurement methods that can be used with a thermistor to determine the temperature. The simplest approach is to use a half-bridge circuit also known as a resistor divider, shown in Figure 1. The goal is to perform a ratiometric measurement such that the VREF source voltage to the divider is the same as the reference to the ADC used to measure the voltage at VT. The R1 resistance is known. The equation for VT is shown in Equation 1:

info/reading_thermistor_tables_with_gcc.txt · Last modified: 2009/01/29 19:49 by tomgee