gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > Temperature Calculation?

#135138 - spinal_cord - Fri Jul 20, 2007 10:50 am

Can anyone tell me the correct way to calculate the temperature using the two diods in the DS. I have tried DegC=8490 * (V_I91 - V_I1) - 273*4096; but I get some quite huge numbers that don't look much like temperatures at all.

Can someone correct this calculation for me?

Thankyou.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#135154 - Cearn - Fri Jul 20, 2007 1:37 pm

The output of formula are .12 fixed-point numbers, not simple integers. Are you correcting for that?

#135193 - spinal_cord - Fri Jul 20, 2007 8:57 pm

you've lost me already :(
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#135195 - Lick - Fri Jul 20, 2007 9:09 pm

Quote:
Temperature Calculation
TP0 decreases by circa 2.1mV per degree Kelvin. The voltage difference between TP1 minus TP0 increases by circa 0.39mV (1/2573 V) per degree Kelvin. At VREF=3.33V, one 12bit ADC step equals to circa 0.8mV (VREF/4096).
Temperature can be calculated at best resolution when using the current TP0 value, and two calibration values (an ADC value, and the corresponding temperature in degrees kelvin):
K = (CAL.TP0-ADC.TP0) * 0.4 + CAL.KELVIN

Alternately, temperature can be calculated at rather bad resolution, but without calibration, by using the difference between TP1 and TP0:
K = (ADC.TP1-ADC.TP0) * 8568 / 4096

To convert Kelvin to other formats,
Celsius: C = (K-273.15)
Fahrenheit: F = (K-273.15)*9/5+32
Reaumur: R = (K-273.15)*4/5
Rankine: X = (K)*9/5


Try this?
_________________
http://licklick.wordpress.com

#135197 - spinal_cord - Fri Jul 20, 2007 9:21 pm

Just googled fixed point math, turns out I know what it is, just not whats its called. I >>12 to the original calculation and I get 27. Does 27?C sound right for a room temperature DS? (19 after a couple of minutes in the freezer, probably a bad idea I know).
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#135205 - calcprogrammer1 - Fri Jul 20, 2007 10:37 pm

The DS has temperature hardware? Weird! Why would Nintendo put a thermometer in the DS anyways? Or is it just a side effect of some component in the DS that is affected by temperature?

Sounds like something to put in DSOrganize or DSLiveWeather...

As for temperature, 25 degrees Celsius sounds about room temperature (if I'm not mistaken, only used Celsius in Chemistry class), cause here in the USA we use Fahrenheit (idk why, the US is just weird or something, they hate standards, almost like Microsoft) and 65 to maybe 75 degrees F is about room temperature-ish.
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.

#135209 - dantheman - Fri Jul 20, 2007 10:47 pm

Moonshell has a temperature gauge you can look at if you want. I believe it's not a temperature reading of the outside temperature but rather that of some internal components, though I'm not certain about this.

#135212 - calcprogrammer1 - Fri Jul 20, 2007 11:01 pm

It says 23.5...is there a way to set it to Fahrenheit? Celsius isn't very useful if you don't know the scale that well...
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.

#135213 - Dood77 - Fri Jul 20, 2007 11:04 pm

spinal_cord wrote:
Does 27?C sound right for a room temperature DS? (19 after a couple of minutes in the freezer, probably a bad idea I know).

Lol! Looking for an excuse to exercise your warranty for a new DS?
Yeah 27 degrees Celsius is usually around what moonshell tells me.
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#135214 - spinal_cord - Fri Jul 20, 2007 11:04 pm

I get the same result as monshell. I think the temperature has something to do with the LCD, I'm not 100% sure though.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#135230 - sonny_jim - Sat Jul 21, 2007 2:08 am

calcprogrammer1 wrote:
The DS has temperature hardware? Weird! Why would Nintendo put a thermometer in the DS anyways?

It's for monitoring the battery I believe, to make sure it doesn't explode and can charge optimally.

#135308 - Dood77 - Sun Jul 22, 2007 3:19 am

calcprogrammer1 wrote:
The DS has temperature hardware? Weird! Why would Nintendo put a thermometer in the DS anyways?

You know, your PC's motherboard most likely has a few thermometers. And maybe even your iPod/Cell Phone. (Or iPhone...?)
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC