0

CPU temperature under reads on RP2040 (Pi Pico)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CPU temperature under reads on RP2040 (Pi Pico)

by kevinjwalters on Thu Feb 18, 2021 10:12 am

My desk is around 25 degrees celsius (my desktop computer heat the area up a bit). Here are some readings from microcontroller.cpu.temperature on a recently powered up Raspberry Pi Pico on my desk:

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 6.2.0-beta.2-18-g2a467f137 on 2021-02-15; Raspberry Pi Pico with rp2040
>>> import microcontroller
>>> microcontroller.cpu[0].temperature
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'Processor' object is not subscriptable
>>> microcontroller.cpu.temperature
17.7757
>>> microcontroller.cpu.temperature
16.8394
>>> microcontroller.cpu.temperature ### about 40 seconds after power up
16.8394
>>> import time
>>> time.monotonic(), microcontroller.cpu.temperature
(56.952, 17.7757)
>>> time.monotonic(), microcontroller.cpu.temperature
(122.795, 16.3713)
>>> time.monotonic(), microcontroller.cpu.temperature
(265.187, 16.8394)
>>> time.monotonic(), microcontroller.cpu.temperature
(506.878, 15.435)


I ran a CircuitPython program for four minutes which did a bit of PWM, not sure if this made any difference.

Code: Select all | TOGGLE FULL SIZE
>>> time.monotonic(), microcontroller.cpu.temperature
(746.805, 17.3076)


This is very wrong as one would expect the self-heating to take this above room temperature. For comparison, the nRF52840 equivalent looks really close to other temperature sensors on-board, see the graphs for nRF52840 CLUE. BTW, I noticed someone else has some magic constants for measuring temperature on the Pi Pico: https://github.com/geerlingguy/baby-saf ... -780556576

kevinjwalters
 
Posts: 883
Joined: Sun Oct 01, 2017 3:15 pm

Re: CPU temperature under reads on RP2040 (Pi Pico)

by tannewt on Thu Feb 18, 2021 3:43 pm

We do the math supplied in the datasheet (section 4.9.4) here: https://github.com/adafruit/circuitpyth ... ssor.c#L45

tannewt
 
Posts: 2189
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.