Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:45 23 May 2026 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 : tempr not working

     Page 1 of 2    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3758
Posted: 03:03pm 20 May 2026
Copy link to clipboard 
Print this post

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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11356
Posted: 03:25pm 20 May 2026
Copy link to clipboard 
Print this post

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.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3758
Posted: 03:59pm 20 May 2026
Copy link to clipboard 
Print this post

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.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11356
Posted: 04:31pm 20 May 2026
Copy link to clipboard 
Print this post

What about 6.02.01 on Geoff's site?
 
mozzie
Guru

Joined: 15/06/2020
Location: Australia
Posts: 337
Posted: 05:00pm 20 May 2026
Copy link to clipboard 
Print this post

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
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8842
Posted: 05:25pm 20 May 2026
Copy link to clipboard 
Print this post

Unless MMBasic does something clever GP29 isn't an ADC input on a RP2350A or B.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3758
Posted: 05:45pm 20 May 2026
Copy link to clipboard 
Print this post

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.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
mozzie
Guru

Joined: 15/06/2020
Location: Australia
Posts: 337
Posted: 05:46pm 20 May 2026
Copy link to clipboard 
Print this post

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
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8842
Posted: 06:16pm 20 May 2026
Copy link to clipboard 
Print this post

Sorry, brain's gone...
I'm concentrating on aquarium stands at the moment, not electronics. It shows, doesn't it?  :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 353
Posted: 06:40pm 20 May 2026
Copy link to clipboard 
Print this post

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.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3222
Posted: 09:46pm 20 May 2026
Copy link to clipboard 
Print this post

  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
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3758
Posted: 11:35pm 20 May 2026
Copy link to clipboard 
Print this post

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
>

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 353
Posted: 11:50pm 20 May 2026
Copy link to clipboard 
Print this post


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

> new
> tempr(gp14,170)
19.75


Jan.
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 171
Posted: 07:18am 21 May 2026
Copy link to clipboard 
Print this post

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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11356
Posted: 08:37am 21 May 2026
Copy link to clipboard 
Print this post

The ds18s20 isn't supported by MMBasic. It functions differently and is not compatible
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3222
Posted: 08:45am 21 May 2026
Copy link to clipboard 
Print this post

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

Joined: 20/09/2024
Location: Germany
Posts: 834
Posted: 08:45am 21 May 2026
Copy link to clipboard 
Print this post

some more info  ..at the time when timeout parameter was introduced
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 171
Posted: 09:00am 21 May 2026
Copy link to clipboard 
Print this post

  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
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 171
Posted: 09:05am 21 May 2026
Copy link to clipboard 
Print this post

  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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11356
Posted: 09:07am 21 May 2026
Copy link to clipboard 
Print this post

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