Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 14:37 29 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM2:Reading the internal chip temperature

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 11:54pm 24 Jul 2015
Copy link to clipboard 
Print this post

PIC32MX chips have an internal temperature sensor. This works by applying a constant current to an internal diode and measuring the forward voltage threshold which varies with temperature. This can then be measured by the ADC in the chip.

Unfortunately, the voltage only changes by about 3mV/degC and the measurement accuracy of the ADC with VCC at 3.3V is also about 3mV so it will only read to 1 degree. Also the threshold voltages of the diodes will vary between chips.

The last downside is that this will only work on the MM (MX170) and not the MM+ (MX470) due to the constant current source in the MM+ being non-functional (another Microchip silicon errata).

Given all this, it may be useful.

This code is tested on both the 28 and 44-pin MM chips running 4.7b23.
Note that the temperature reading can be calibrated for an individual chip by putting a frig-factor in the call to the read routine

do
print readinternaltemp()
pause 1000
loop
' Function to read the internal temperature on a 28 or 44-pin Micromite
' Takes one optional parameter which is an offset in degrees to compensate for chip variations
' so readinternaltemp(2) would add 2 degrees to the reading
' NB: the accuracy is relatively poor due to the limitations of the 10-bit ADC
'
CFunction readinternaltemp
00000000
27bdffc8 afbf0034 afbe0030 afb7002c afb60028 afb50024 afb40020 afb3001c
afb20018 afb10014 afb00010 afa40038 3c030200 34638001 3c02bf81 ac43a200
3c031000 3c02bf88 ac431064 3c02bf88 ac401068 34038000 3c02bf81 ac439004
24100001 00008821 3c12bf81 3c13000d 3c14bf88 3c15bf88 3c16bf81 3c17ffff
10000002 3c1ebf81 26100001 ae539040 ae806118 aea06108 aed79050 34028f00
afc29020 24060003 3c03bf81 ac669010 240300e4 3c02bf81 ac439000 34028000
3c06bf81 acc29008 3c04bf88 3c031000 8c821030 00431024 1040fffd 3c02bf81
8c429070 02228821 24020001 12020039 3c031000 3c02bf88 ac431034 3c029d00
8c420004 0040f809 240403e8 2a020009 1440ffde 26100001 3c031000 3c02bf88
ac431064 3c02bf88 ac401068 34038000 3c02bf81 ac439004 3c02bf81 ac40a200
8fa30038 14600009 24020588 00518823 26220007 2a230000 0223100a 000210c3
2442001c 1000000f 00021fc3 00518823 26220007 2a240000 0044880b 001120c3
2484001c 00042fc3 8fa60038 8cc20000 8cc30004 00821021 0044202b 00a31821
00831821 8fbf0034 8fbe0030 8fb7002c 8fb60028 8fb50024 8fb40020 8fb3001c
8fb20018 8fb10014 8fb00010 03e00008 27bd0038 3c02bf88 ac431034 3c029d00
8c420004 0040f809 240403e8 1000ffa6 00008821
End CFunction 'MIPS32 M4K
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 12:44am 25 Jul 2015
Copy link to clipboard 
Print this post

Mine was out by 10'C does that sound about right?

I have been comparing it to my Multimeter with the Probe set below the Chip and they appear to be tracking each other quite well. Only tested for 15 min with a correction factor of -10 but so far it looks promising.

I have turned off the heaters and will be out for the next couple of hours so the temperature should fall a few degrees (It is cold in Cape Town today) by the time I get back, so it should be a good test.

Cheers
Chris

http://caroper.blogspot.com/
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 01:32am 25 Jul 2015
Copy link to clipboard 
Print this post

  Quote  Mine was out by 10'C does that sound about right?


Can't really comment, I tested using a IR thermometer aimed at the chip and set the internal calibration as the average of two chips.

But as long as it tracks reasonably it is probably OK. It is really only good for checking for the chip overheating or perhaps cold junction for a thermocoupleEdited by matherp 2015-07-29
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024