Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:20 24 Apr 2025 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 : PicoMite V6.00.02 betas

     Page 23 of 23    
Author Message
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2925
Posted: 05:49pm 09 Mar 2025
Copy link to clipboard 
Print this post

I have used many different 1-Wire devices in the past (directly linked to PICs, and also with MMBASIC) and they work great PROVIDING you use genuine parts AND observe the datasheet parameters. Buying a pack of 10 'sensors' for $1 is not recommended for 1-wire (I have been down that path and it is NOT worth the headache)

NOTE: From the datasheet:

R0, R1: Thermometer resolution bits. Table 3 below defines the resolution of the digital thermometer, based on the settings of these 2 bits. There is a direct tradeoff between resolution and conversion time, as depicted in the AC Electrical Characteristics. The factory default of these EEPROM bits is R0=1 and R1=1 (12-bit conversions).

Thermometer Resolution Configuration

R1 R0  Thermometer Resolution    Max Conversion Time
0   0         9 bit               93.75 ms (tconv/8)
0   1        10 bit              187.50 ms (tconv/4)
1   0        11 bit              375.00 ms (tconv/2)
1   1        12 bit              750.00 ms (tconv)
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 06:14pm 09 Mar 2025
Copy link to clipboard 
Print this post

MMBasic uses 10-bit as the default with the tempr function and allows 100mSec, 200mSec, 400mSec and 800mSec for the various modes. If the DS18B20 isn't ready after these times MMBasic returns 1000. This algorithm hasn't changed since the original Maximite
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6206
Posted: 08:36pm 09 Mar 2025
Copy link to clipboard 
Print this post

There is a very long thread from August 2020 discussing DS18B20 chips that are out of spec.

My tests were done on the CMM2 and may need some tweaking to run on the pico.

I will try and do some testing later in the week when I get back home.

https://www.thebackshed.com/forum/ViewTopic.php?TID=12339&PID=152037#152037#152037

Jim
VK7JH
MMedit
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 65
Posted: 09:19pm 09 Mar 2025
Copy link to clipboard 
Print this post

  WhiteWizzard said  
NOTE: From the datasheet:

R0, R1: Thermometer resolution bits. Table 3 below defines the resolution of the digital thermometer, based on the settings of these 2 bits. There is a direct tradeoff between resolution and conversion time, as depicted in the AC Electrical Characteristics. The factory default of these EEPROM bits is R0=1 and R1=1 (12-bit conversions).

Thermometer Resolution Configuration

R1 R0  Thermometer Resolution    Max Conversion Time
0   0         9 bit               93.75 ms (tconv/8)
0   1        10 bit              187.50 ms (tconv/4)
1   0        11 bit              375.00 ms (tconv/2)
1   1        12 bit              750.00 ms (tconv)


  matherp said  MMBasic uses 10-bit as the default with the tempr function and allows 100mSec, 200mSec, 400mSec and 800mSec for the various modes. If the DS18B20 isn't ready after these times MMBasic returns 1000. This algorithm hasn't changed since the original Maximite


@WhiteWizzard, @Peter:

I didn't know that the DS18B20 had a configurable resolution! I simply ordered a few from a Chinese company I trust and used them on an Arduino UNO and it worked - with 12 bits of resolution. You learn something new every day  - thanks to you too!

I just took the trouble to take a quick look at the data sheet: The resolution must be specified by a "Write Configuration Register". What happens if a transmission error occurs (e.g. due to interference or poor power supply)? I'm not sure that a CRC check is carried out before the data is transferred to the RAM?

The data sheet says:
"Byte 8 of the scratchpad is read-only and contains the
CRC code for bytes 0 through 7 of the scratchpad.
The DS18B20 generates this CRC using the method
described in the CRC Generation section.
Data is written to bytes 2, 3, and 4 of the scratchpad using
the Write Scratchpad [4Eh] command; the data must be
transmitted to the DS18B20 starting with the least signifi-
cant bit of byte 2. To verify data integrity, the scratchpad
can be read (using the Read Scratchpad [BEh] command)
after the data is written."

That sounds like it would be left to the user to test?

bfwolf.
Edited 2025-03-10 07:22 by bfwolf
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2398
Posted: 12:14am 10 Mar 2025
Copy link to clipboard 
Print this post

  MatherP said  This algorithm hasn't changed since the original Maximite
That being the case and it does work for genuine DS18B20 units it can't be expected to work as per the manual on all non genuine ones.

That said my two non genuine ones behave a little differently on b17 than they did on V6.01.01. Minor adjustments to programs can compensate for that.

Will carry out further experiments on the DS18B20 thread linked to by TassyJim.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6206
Posted: 02:12am 10 Mar 2025
Copy link to clipboard 
Print this post

V6.00.02b17 Standard picomite with no options set.

Known good DS18B20 and 'slow' module from Jaycar both work as expected.

Jim
VK7JH
MMedit
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 279
Posted: 06:17am 10 Mar 2025
Copy link to clipboard 
Print this post

it seems used it wrong, so post deleted
Edited 2025-03-10 16:19 by electricat
My MMBasic 'sand box'
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4809
Posted: 07:34am 10 Mar 2025
Copy link to clipboard 
Print this post

Please be aware that the 2350 suffers from a GPIO pin fault. This is a hardware fault, that changes the input impedance if the pin is used as input.
This may have impact on the DS18B20 in powered mode, but definitely will impact the behaviour of the DS18B20 when used in slave power mode.

For slave power mode, use a 2040, just to be sure.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 07:59am 10 Mar 2025
Copy link to clipboard 
Print this post

  Quote  Please be aware that the 2350 suffers from a GPIO pin fault. This is a hardware fault, that changes the input impedance if the pin is used as input.
This may have impact on the DS18B20 in powered mode, but definitely will impact the behaviour of the DS18B20 when used in slave power mode.


Slave power mode works fine on RP2350. I programmed round the E9 issue.

Re: a previous comment about the DS18B20 not respecting the resolution - it does
However if the actual temperature is 23.5 all resolutions will show 23.5. If the actual temperature is 23.625 then resolutions 0 and 1 will show 23.5 and 2 and 3 will show 23.625.
Edited 2025-03-10 19:56 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 07:24pm 10 Mar 2025
Copy link to clipboard 
Print this post

I've updated the betas for HDMI and RP2350 VGA to b18

These now all support 848x480 widescreen - same as mode 10 on the CMM2

To use the new resolution on HDMI use:
OPTION RESOLUTION 848

Valid modes are:
1: 848 x 480 x 1bit with tiles
2: 424 x 240 x 4-bit with 1 layer buffer
3: 848 x 480 x 4-bit
5: 424 x 240 x 8-bit RGB332

On VGA use:
OPTION WIDESCREEN ON/OFF

Valid modes are:
1: 848 x 480 x 1bit with tiles
2: 424 x 240 x 4-bit with 1 layer buffer
3: 848 x 480 x 4-bit

I assume only a proper widescreen monitor will show these correctly. CPU speed is 336MHz for both VGA and HDMI



Edited 2025-03-11 05:25 by matherp
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 65
Posted: 08:51pm 10 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  
Re: a previous comment about the DS18B20 not respecting the resolution - it does
However if the actual temperature is 23.5 all resolutions will show 23.5. If the actual temperature is 23.625 then resolutions 0 and 1 will show 23.5 and 2 and 3 will show 23.625.


Did you mean my comment?

I didn't mean to suggest that it was the software..
So if the DS18B20 receives the data correctly, it should also set the resolution and timing correctly.
But suppose 1 or more bits were received incorrectly by the DS18B20 (e.g. due to interference or because it's a "bad chip")? Then it could be that it takes the measurement with 11 or 12 bits of resolution and of course takes longer to do so.
That would also explain why an additional delay seemed to help.

Regarding the new widescreen modes: Nice feature!

bfwolf
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 10:51pm 10 Mar 2025
Copy link to clipboard 
Print this post

  Quote  But suppose 1 or more bits were received incorrectly by the DS18B20 (e.g. due to interference or because it's a "bad chip")? Then it could be that it takes the measurement with 11 or 12 bits of resolution and of course takes longer to do so.
That would also explain why an additional delay seemed to help.

Very unlikely to be the case. Much more likely that the "bad" chip takes longer to do the conversion. Jim's code in the other thread tests this when powered (not parasitic) and tells how long each chip takes for each resolution
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 209
Posted: 11:34am 11 Mar 2025
Copy link to clipboard 
Print this post

just had a strange effect with b17 on an RP2350 ....

The touchpad with an FT3663 stopped working, dunno exactly when, probably after an upgrade to b16 or b17. Checked wiring and options, all ok.

Anyway, cleared flash with Clear_Flash_RP2350.uf2 ... to no avail. Reflashed from b7 onwards, no cure.

Flashed b17 again and then OPTION TOUCH DISABLE and setting the touch option again as FT3663 and it worked again. So for some reason the Clear_Flash_RP2350.uf2 did not reset the flash completely, some garbage must have been left over which in turn upset the touch option.

So my question: is there any better way to completely wipe the flash on either pico or pico2 then with the Clear_Flash(_RP2350) utlities?

Reagrds,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 279
Posted: 04:03pm 11 Mar 2025
Copy link to clipboard 
Print this post

@Peter,
HDMI/USB/2350 02b17
Yesterday moved from 02b11 to 02b17

One of my programs I am working on started to fail executing line with --> execute "files"
Loaded older versions - same.

OK. entered
cmd NEW,
then two simple lines
chdir "b:\somepath" ' dir with 8 files
execute "files"

First run, files were listed.
Next and folowing runs - command timeout, restart, mm.watchdog always returns ->> 0

After reboot, loaded my program i was working on. Failed.
Again, NEW, typed in two lines. This time failed on first run.

Did not tried to roll back to 02b11 or flash 02b18 yet.
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 04:12pm 11 Mar 2025
Copy link to clipboard 
Print this post

FILES used in a program does some heavy sh*t to work. You can't use it with execute. Just use it direct

Manual entry on EXECUTE
  Quote  This executes the Basic command "command$". Use should be limited to basic
commands that execute sequentially for example the GOTO statement will not
work properly
Things that are tested and work OK include GOSUB, Subroutine calls, other
simple statements (like PRINT and simple assignments)
Multiple statements separated by : are not allowed and will error
The command sets an internal watchdog before executing the requested
command and if control does not return to the command, like in a GOTO
statement, the timer will expire. In this case you will get the message
"Command timeout".
RUN is a special case and will cancel the timer allowing you to use the
command to chain programs if required.

Edited 2025-03-12 02:36 by matherp
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 279
Posted: 06:47am 12 Mar 2025
Copy link to clipboard 
Print this post

I read you. It brokes itself internally trying to lift to heavy weights   .
Still I feel, I must excuse and explain, why 'user' is boring You    

MM.WATCHDOG returns 0 after "crash restart" but after "Command timeout" there should be 1

Before posting observation I was so naive and tried also 'control' watchdog using all combinations of WATCHDOG timeout or WATCHDOG OFF or WATCHDOG HW timeout or WATCHDOG HW OFF

My idea was. If EXECUTE is command under caution about it`s 'dangers' in use, and I understand it resets reason (maybe) becouse of watchdog (while 0 indicates it is not the case, but still), maybe I can order it wait a little bit more.

I can do file listing by simple writing procedure on exit.
BUt... The cat died due to its excessive curiosity. .
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9957
Posted: 07:59am 12 Mar 2025
Copy link to clipboard 
Print this post

  Quote  MM.WATCHDOG returns 0 after "crash restart" but after "Command timeout" there should be 1


Sorry but it is my choice not to return 1 in MM.WATCHDOG because a command timeout is different from a "real" watchdog timeout

You shouldn't use EXECUTE for any command that doesn't return pretty much immediately so if you get a command timeout it is a programming error that needs fixing.
Edited 2025-03-12 18:04 by matherp
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 209
Posted: 03:14pm 12 Mar 2025
Copy link to clipboard 
Print this post

@Peter,

just trying to get a touch panel with a FT6336 controller working. TOUCH(x/y) do report valid coordinates. The problem is, that there is no response to TOUCH INTERRUPT and also no resonse to any of the touch sensitive GUI components.

Environment:

PicoMite MMBasic RP2350A Edition V6.00.02b18
OPTION SYSTEM SPI GP2,GP3,GP4
OPTION SYSTEM I2C GP0,GP1
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED  300000 'KHz
OPTION DISPLAY 45, 132
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP5,GP6,GP7,GP8,INVERT
OPTION GUI CONTROLS 75
OPTION TOUCH FT6336 GP10,GP9,,50
GUI CALIBRATE 1, 314, 6, -10276, 10588
OPTION SDCARD GP11

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 65
Posted: 05:03pm 12 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  FILES used in a program does some heavy sh*t to work. You can't use it with execute. Just use it direct

Manual entry on EXECUTE
  Quote  This executes the Basic command "command$". Use should be limited to basic
commands that execute sequentially for example the GOTO statement will not
work properly
Things that are tested and work OK include GOSUB, Subroutine calls, other
simple statements (like PRINT and simple assignments)
Multiple statements separated by : are not allowed and will error
The command sets an internal watchdog before executing the requested
command and if control does not return to the command, like in a GOTO
statement, the timer will expire. In this case you will get the message
"Command timeout".
RUN is a special case and will cancel the timer allowing you to use the
command to chain programs if required.


@Peter, @electricat:

Would this be runable from "EXECUTE"?

> list
Sub PrintFiles(byval Path$ As string)
 Local f$ As String
 f$ = Dir$(Path$)
 Do While f$ <> ""
   Print f$
   f$ = Dir$()
 Loop
End Sub

PrintFiles("a:\")
End
> run
bootcount
byref-byval.bas
timer.bas
>


bfwolf
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 211
Posted: 10:59pm 12 Mar 2025
Copy link to clipboard 
Print this post

Maybe a special case:
> option list
PicoMite MMBasic USB RP2040 Edition V6.00.02b18
OPTION SERIAL CONSOLE COM1,GP28,GP29
OPTION SYSTEM SPI GP22,GP23,GP20
OPTION SYSTEM I2C GP24,GP25
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION KEYBOARD US, 0, 0, 150, 50
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION CPUSPEED  378000 'KHz
OPTION LCDPANEL CONSOLE 4
OPTION DISPLAY 30, 80
OPTION LCDPANEL SSD1963_7, LANDSCAPE,,GP16,NORESET
OPTION TOUCH GP21,GP19
GUI CALIBRATE 1, 101, 404, 2019, 1378
OPTION SDCARD COMBINED CS
OPTION KEYBOARD REPEAT 150,50
OPTION RTC AUTO ENABLE
OPTION DEFAULT FONT 4, 1
>
> print mm.info(sdcard)
Not Configured
>


My main issue is of cause the sdcard but:
Once "option display" is set, I have no idea how to get rid of it again.

Answer: "option display 24,80" will let it disappear from the option list again.
Edited 2025-03-13 20:58 by dddns
 
     Page 23 of 23    
Print this page


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

© JAQ Software 2025