Hi,
I'm aware that readinternaltemp cannot give the accuracy of a dedicated sensor (of any type) and that IMHO Microchip made a silly mistake in "hanging" the sensing diodes from the supply rail (so the FVR cannot be used to eliminate supply voltage variations), instead of referencing them to ground. However, for a measurement in my current project I would like to compensate for the (temperature-varying) voltage drop of an external diode. Since neither this diode nor the PICaxe will dissipate any significant power (i.e. negligible self-heating) they should track reasonably well, so it "should" be possible to achieve around an order of magnitude improvement. However, I can't get any "sensible" results from readinternaltemp.
My original prototype used a 3 volt rail (2 x AA cells), but IT_3V0 produced a "temperature" of about 6200 (which wasn't particularly plausible even when truncated to a single byte). IT_RAW_L produced a value in the 300s which implies about one volt drop across each diode (instead of the expected 600 - 700 mV each).
So I created a basic test program and changed to a 3 cell supply (4.25 volts) to allow _H, _L , _4V0 and _4V5 all to be tested (with a 20M2 and PE 5.5.6). Now, the basic value (using IT_4V5) seems reasonable (provided the high byte of the word is ignored) but the RAW values still look "wrong". Using _L should give around 725 (two diode drops below the supply rail, e.g. 1023 - 300) and _H around 450 (four diode drops below the supply rail), but they almost appear exchanged.
Furthermore, when I put the breadboard into the freezer for an hour or two (say -20 degrees C, compared with the current room temperarure of +25 degees C), the "temperature" fell by only about 15 degrees. Also, both _L and _H fell by hardly more than 2mV/degC (compared with the expected 3-4 and 7-8 mV/degC of 2/4 diodes). Here's my test code with typical results pasted below. Am I doing something wrong?
.
Thanks, Alan.
I'm aware that readinternaltemp cannot give the accuracy of a dedicated sensor (of any type) and that IMHO Microchip made a silly mistake in "hanging" the sensing diodes from the supply rail (so the FVR cannot be used to eliminate supply voltage variations), instead of referencing them to ground. However, for a measurement in my current project I would like to compensate for the (temperature-varying) voltage drop of an external diode. Since neither this diode nor the PICaxe will dissipate any significant power (i.e. negligible self-heating) they should track reasonably well, so it "should" be possible to achieve around an order of magnitude improvement. However, I can't get any "sensible" results from readinternaltemp.
My original prototype used a 3 volt rail (2 x AA cells), but IT_3V0 produced a "temperature" of about 6200 (which wasn't particularly plausible even when truncated to a single byte). IT_RAW_L produced a value in the 300s which implies about one volt drop across each diode (instead of the expected 600 - 700 mV each).
So I created a basic test program and changed to a 3 cell supply (4.25 volts) to allow _H, _L , _4V0 and _4V5 all to be tested (with a 20M2 and PE 5.5.6). Now, the basic value (using IT_4V5) seems reasonable (provided the high byte of the word is ignored) but the RAW values still look "wrong". Using _L should give around 725 (two diode drops below the supply rail, e.g. 1023 - 300) and _H around 450 (four diode drops below the supply rail), but they almost appear exchanged.
Furthermore, when I put the breadboard into the freezer for an hour or two (say -20 degrees C, compared with the current room temperarure of +25 degees C), the "temperature" fell by only about 15 degrees. Also, both _L and _H fell by hardly more than 2mV/degC (compared with the expected 3-4 and 7-8 mV/degC of 2/4 diodes). Here's my test code with typical results pasted below. Am I doing something wrong?
Code:
#picaxe 20m2
#no_data
do
readinternaltemp it_4v0,0,w0
readinternaltemp it_4v5,0,w4
readinternaltemp it_raw_L,0,w1
readinternaltemp it_raw_H,0,w2
calibadc10 w3
sertxd(#w0," ",#w4," ",#b0," ",#w1," ",#w2," ",#w3,cr,lf)
pause 1000
loop
#rem 4.25v supply
4v0 4v5 b0 _L _H adc10
283 271 27 557 736 248 Room Temperature ~ 25 degC
267 253 11 541 716 250 From Freezer ~ -20 degC
281 269 25 554 733 248 Warm again
Thanks, Alan.