Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4476

MicroPython • Internal temperature sensor not accessible on Pico 2?

$
0
0
I'm just playing around and tried to read the internal temperature sensor ("core temp"), but I can't get it to work (in serial console).
When I try setting it up I get an error saying that the pin doesn't have ADC capabilities.

The example I started with is found here: https://github.com/raspberrypi/pico-mic ... erature.py (as well as in some docs).
But I've also looked at RP2350 datasheet to confirm that it's the right channel, etc.

Here's some examples of what I've tried (removed Traceback for brevity):

Code:

>>> sensor_temp = machine.ADC(4)ValueError: Pin doesn't have ADC capabilities>>> adc = ADC(ADC.CORE_TEMP)ValueError: Pin doesn't have ADC capabilities
ADC.CORE_TEMP does return 4

I can setup and read from other ADCs

Code:

>>> adc = ADC(0)>>> adc.read_u16()11522>>> adc = ADC(29)>>> adc.read_u16()30135

Code:

MicroPython v1.24.0-preview.201.g269a0e0e1 on 2024-08-09; Raspberry Pi Pico2 with RP2350-RISCV
Also tried on

Code:

MicroPython v1.24.0-preview.201.g269a0e0e1 on 2024-08-09; Raspberry Pi Pico2 with RP2350
Is there a trick I'm missing, is it a bug/not yet supported??

Statistics: Posted by ChrisHinde — Mon Aug 26, 2024 9:27 pm — Replies 0 — Views 22



Viewing all articles
Browse latest Browse all 4476

Trending Articles