ReadInternalTmp

cachomachine

Senior Member
I am looking for a aproximative table of temp. vs value for the command readinternaltemp IT_5V0,0,b1 using a 14M2.
I do not need a precise value, just want to know if i am in the range -30C or -25C or -20C up to +20C in increments of 5 degrees.
 

g6ejd

Senior Member
What I've noted is CPU temp and extenal temp are offset(chip heating), so now bring to the problem heating and cooling of the environment and unless someone has done this, I expect making a correlation is not going to be easy. That said, you can easily determine the offset at a rfange of attainable temperatures, such as room, outside temp, a fridge and freezer (run it on batteries) and from that make a good estimate of the likely wider range correlation with (hopefully) a linear scale, or if not there would be sufficient points to perform a linear regression to which you can apply your reading to get actual (estimated) temp. I have not checked the PIC operating temperature range, but assume you have to ensure your starting off towards an attainable outcome.
 

AllyCat

Senior Member
Hi,

The manual (2 page 175) implies that the PICaxe attempts to return the approximate temperature directly in degrees C. That would require a little "number crunching" for degrees F and/or for negative temperatures (not mentioned but presumably they just wrap around via $FF (255).

However, the IT_RAW_L parameter might be easier to use. The raw hardware measures the voltage across 2 silicon diodes (4 for _H ) which should each have a forward drop of about 700mV at zero deg C (perhaps 750mV at zero deg F) and a negative temperature coefficient of about 2mV/degree C (or -1mV/degree F). But the manual doesn't appear to specify the reference voltage used for the A/D conversion (supply rail or 2 volts FVR ?). The formulae on page 176 might suggest the FVR.

Cheers, Alan.
 

hippy

Technical Support
Staff member
Microchip AN1333 provides some detail on the Internal Temperature Module -

http://ww1.microchip.com/downloads/en/AppNotes/01333A.pdf

Figure 4 gives the clearest idea of temperature versus ADC reading, though ADC is 8-bit there and the PICAXE uses 10-bit. The references used I believe are the power rails.

Figure 5 shows how the temperatures can be offset vertically depending on chip, and Figures 6 and 7 show how the slope can vary, mostly with power supply voltage.

The formulas in the manual are a rough match for a typical vertical offset and slope that was found in the samples we tested to convert ADC readings to degree C and is primarily for positive temperatures.

To get the most accurate conversion it is best to take a RAW_H or RAW_L reading and apply an equation based on an actual calibration of the chip. To handle negatives it's probably easiest to offset temperatures, for example, so -40C reads as 0, 0C reads as 40, 100C reads as 140 after the appropriate equation has been applied.

Alternatively, work through the temperature split points you are looking for, make a note of the raw readings, then use those as constants to compare against to determine band. This can avoid accuracy issues in the equations.
 
Top