Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : tempr not working

   Page 1 of 4    
Posted: 03:03pm
20 May 2026
Copy link to clipboard
lizby
Guru

With the latest version, ?tempr isn't working for me on an RP2350-Zero. I reflashed V6.00.01 and it worked; flashed again immediately with V6.03.00RC9 and it returns 1000. It does this on all the pins I have tried.

PicoMite MMBasic RP2350A Edition V6.00.01
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

> ?tempr(gp29)
25
PicoMite MMBasic RP2350A V6.03.00RC9
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

Formatting the A: drive
> ?tempr(gp29)
1000
>


~
Edited 2026-05-21 01:04 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
Posted: 03:25pm
20 May 2026
Copy link to clipboard
matherp
Guru

Haven't got a ds18b20 with me so can't really look at it for the next couple of weeks. Can you find in which version it first stopped working then I might have a chance.
 
Posted: 03:59pm
20 May 2026
Copy link to clipboard
lizby
Guru

It fails at RP2350A V6.01.00

PicoMite MMBasic RP2350A V6.01.00
Copyright 2011-2025 Geoff Graham
Copyright 2016-2025 Peter Mather

Formatting the A: drive
> ?tempr(gp29)
1000


I don't have anything between RP2350A V6.00.01 and V6.01.00, and Geoff's archive doesn't contain and V6 versions. (Unfortunately, V6.00.01 doesn't contain trim$--I'll cobble a version.)
 
Posted: 04:31pm
20 May 2026
Copy link to clipboard
matherp
Guru

What about 6.02.01 on Geoff's site?
 
Posted: 05:00pm
20 May 2026
Copy link to clipboard
mozzie
Guru

G'day Lizby,
Have you tried other pins? Works here on GP0 / GP28 on RP2350A V6.03.00RC9

> option list
PicoMite MMBasic RP2350A V6.03.00RC9
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 200000
OPTION LCDPANEL ST7796S, LANDSCAPE,GP14,GP13,GP12
OPTION GUI CONTROLS 64
OPTION TOUCH GP15,GP17
GUI CALIBRATE 0, 3978, 3840, -1298, -868
> ? tempr(gp0)
26.25
> ? tempr(gp28)
26
>


This is on a RPI Pico2 so no access to GP29

Regards, Lyle.

Edit: Just re-read your original post and it appears you have tried other pins  
Edited 2026-05-21 03:03 by mozzie
 
Posted: 05:25pm
20 May 2026
Copy link to clipboard
Mixtel90
Guru


Unless MMBasic does something clever GP29 isn't an ADC input on a RP2350A or B.
 
Posted: 05:45pm
20 May 2026
Copy link to clipboard
lizby
Guru

PicoMite MMBasic RP2350A V6.03.00RC9
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

> ?tempr(GP5)
1000
> ?tempr(GP0)
1000
> option list
PicoMite MMBasic RP2350A V6.03.00RC9
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 340000
> ?tempr(GP0)
1000
> ?tempr(GP1)
1000
> update firmware
PicoMite MMBasic RP2350A Edition V6.00.01
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

> ?tempr(gp1)
25
> update firmware
PicoMite MMBasic RP2350A V6.02.01
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

Formatting the A: drive
> ?tempr(gp1)
1000
>


No go for me with RP2350A V6.02.01. I don't understand why RP2350A V6.03.00RC9 worked for Lyle but not for me.
 
Posted: 05:46pm
20 May 2026
Copy link to clipboard
mozzie
Guru

G'day Lizby,
Managed to find the RP2350-Zero purchased by mistake, GP29 does work with the DS18B20:

> option list
PicoMite MMBasic RP2350A V6.03.00RC4
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 200000
OPTION DISPLAY 40, 80
> ? tempr(gp29)
25.25
>


This is using the "Normal Power" option as shown in the manual, I had a heap of trouble with the "Parasitic Power" system as it seems to be quite dependent on device quality. Maybe this is causing what you are seeing.

Might also be worth trying TEMPR START with a long timeout, I think this helped with slow sensors. Strange it worked on the older version though  

Mick, the DS18B20 uses the one wire protocol so will work on any pin, the TMP37 etc is perhaps what you have in mind?

Regards, Lyle.
Edited 2026-05-21 03:54 by mozzie
 
Posted: 06:16pm
20 May 2026
Copy link to clipboard
Mixtel90
Guru


Sorry, brain's gone...
I'm concentrating on aquarium stands at the moment, not electronics. It shows, doesn't it?  :)
 
Posted: 06:40pm
20 May 2026
Copy link to clipboard
JanVolk
Guru

G'day Lizby,

Rejected DS18B20 temperature sensors are left out in later versions and can be used with an extra timeout.
Or try the code below.


' Function TEMPR() and TEMPW() Dallas DS18B20. V6.03.00RC10
Const Pin$="GP14"

Do
 Print
 Print "DS18B20 TEMPW(";Pin$;"):"; Str$(TEMPW(Pin$),3,2);" ";     Chr$(176);"C"
 Print "DS18B20 TEMPR(GP14):";     Str$(TEMPR(GP14),3,2);" ";     Chr$(176);"C"
 Print "DS18B20 TEMPR(GP14):";     Str$(TEMPR(GP14,200),3,2);" "; Chr$(176);"C"
 ' TEMPR(pin [,timeout])   Manual: Ver 6.02.01 Page 200  PicoMite User Manual.
 Pause 5000
Loop

Function TEMPW(Pin$)
 Local T1,T2,b,t
 OneWire Reset Pin$
 OneWire Write Pin$,1,2,&HCC,&H44
 Pause 80
 t=Timer
 OneWire Write Pin$,1,2,&HCC,&HBE
 OneWire Read  Pin$,2,2,T1,T2
 TEMPW = ((T2 And &B111)*256+T1)/16
 If T2 And &B1000 Then TEMPW=-TEMPW
End Function


Jan.
 
Posted: 09:46pm
20 May 2026
Copy link to clipboard
phil99
Guru


  mozzie said  Might also be worth trying TEMPR START with a long timeout

Yes, I have one that is fussy about that.
TEMPR START is essential for that one, and it reads a bit high so I think it's a fake.
Sub DS18B20
  TEMPR START 9,3
  TEMPR START 10,3
  DS1 = Cint(TEMPR(9)*10)/10
  DS2 = Cint(TEMPR(10)*10)/10
End Sub

Edited 2026-05-21 07:53 by phil99
 
Posted: 11:35pm
20 May 2026
Copy link to clipboard
lizby
Guru

The timeout fixes it:
PicoMite MMBasic RP2350A V6.02.01
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

> ?tempr(gp1,500)
24.25
> ?tempr(gp1)
1000
>
> update firmware
PicoMite MMBasic RP2350A V6.03.00RC9
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

Formatting the A: drive
> ?tempr(gp1)
1000
> ?tempr(gp1,300)
1000
> ?tempr(gp1,400)
1000
> ?tempr(gp1,500)
24.75
>
 
Posted: 11:50pm
20 May 2026
Copy link to clipboard
JanVolk
Guru


PicoMite MMBasic RP2350A V6.03.00RC10
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

> new
> tempr(gp14,170)
19.75


Jan.
 
Posted: 07:18am
21 May 2026
Copy link to clipboard
Peter63
Senior Member

Have tried connecting DS18S20 (yes S20)  
Getting strange values, have tested 4 out of 10 that I have...
> new
> tempr(gp7)
10.625
> tempr(gp7)
10.625
> tempr(gp7)
10.625
> tempr(gp7,170)
10.625
> tempr(gp7,170)
10.625
> tempr(gp7,800)
3.1875
> tempr(gp7,800)
3.1875
> tempr(gp7,800)
3.1875


I have a temperature of 25 degrees in the room.

using PicoMite MMBasic USB RP2350B Edition V6.03.00RC10


tested and the device DS18S20, works on an Arduino UNO (5V)

/Peter63
Edited 2026-05-21 17:50 by Peter63
 
Posted: 08:37am
21 May 2026
Copy link to clipboard
matherp
Guru

The ds18s20 isn't supported by MMBasic. It functions differently and is not compatible
 
Posted: 08:45am
21 May 2026
Copy link to clipboard
phil99
Guru


Does this make any difference?
> TEMPR START gp7,3 : TEMPR(gp7)
 
Posted: 08:45am
21 May 2026
Copy link to clipboard
dddns
Guru

some more info  ..at the time when timeout parameter was introduced
 
Posted: 09:00am
21 May 2026
Copy link to clipboard
Peter63
Senior Member

  Quote  some more info  ..at the time when timeout parameter was introduced

i tested the program
  Quote  TassyJim's test program with some mods for the PicoMite.


, and this display OK temp value...

Family name: DS1820/DS18S20
Rom Code:    10 B4 65 B5 02 08 00 CA
ScratchPad:  32 00 00 00 FF FF 0A 10
Power mode   Parasitic


ScratchPad:  32 00 FF FF FF FF 0A 10
Temperature:  25.0625  775.005mS, 9 bit

ScratchPad:  32 00 FF FF FF FF 0B 10
Temperature:  25.125  774.997mS, 10 bit

ScratchPad:  32 00 FF FF FF FF 0A 10
Temperature:  25.1875  774.974mS, 11 bit

ScratchPad:  32 00 FF FF FF FF 09 10
Temperature:  25.1875  774.985mS, 12 bit

Tempr() without start    10.625
Tempr Start Pin,0        10.625
Tempr Start Pin,1        10.625
Tempr Start Pin,2        10.625
Tempr Start Pin,3        3.125


huummm... /Peter63
 
Posted: 09:05am
21 May 2026
Copy link to clipboard
Peter63
Senior Member

  Quote  Does this make any difference?
> TEMPR START gp7,3 : TEMPR(gp7)


result...

  Quote  > tempr start gp7,3:tempr(gp7)
3.125
> tempr start gp7,3:tempr(gp7)
3.1875
> tempr start gp7,3:tempr(gp7)
3.1875


/Peter63
 
Posted: 09:07am
21 May 2026
Copy link to clipboard
matherp
Guru

The ds18s20 isn't supported by MMBasic. It functions differently and is not compatible
 
   Page 1 of 4    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026