Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:55 16 Oct 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.01.00 release candidates

     Page 1 of 3    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 11:05am 10 Oct 2025
Copy link to clipboard 
Print this post

V6.01.00RC0


PicoMiteV6.01.00RC0.zip


V6.01.00 is now closed and hopefully not too many bugs to find and fix. This is the same as b20 with 2 changes:
Fixes bug in drawing circle with thick boundary and no fill colour
Add new bonus graphics command for all versions.
FILL x, y, colour


This reads the colour at position x,y in the display and then fills the area from that point where the current colour is the same. Note it will be slow on TFT displays using unbuffered drivers. The new SDD1963 buffered drivers and VGA and HDMI versions all perform well.

See the example video

' Random Closed Shape Generator - MMBasic Subroutine
' Test harness and subroutine

Dim inx%, iny%
Option Explicit
If Instr(MM.DEVICE$,"VGA") Or Instr(MM.DEVICE$, "HDMI") Then MODE 2
FRAMEBUFFER create
FRAMEBUFFER write f
Do
CLS
shape inx%, iny%
Fill inx%, iny%, RGB(Rnd*255,Rnd*255,Rnd*255)
FRAMEBUFFER copy f,n
Pause 250
Loop

' Creates an interesting random closed polygon with convex and concave sections
' Returns coordinates of a point inside the shape via x% and y% parameters

Sub shape(x%, y%)
   Local margin, minX, maxX, minY, maxY
   Local centerX, centerY, numPoints
   Local baseRadius, i, angle, radiusVariation, radius
   Local x1, y1, x2, y2, dx, dy, sx, sy, err, px, py, e2
   Local foundInside
   Local pointX(50), pointY(50)  ' Maximum possible points is 32, so 50 is safe

   ' Get screen dimensions with margins
   margin = 30
   minX = margin
   maxX = MM.HRES - margin - 1
   minY = margin
   maxY = MM.VRES - margin - 1

   ' Calculate random center point within the screen bounds
   ' Ensure enough space for the shape around the center
   centerX = minX + margin + Rnd * (maxX - minX - 2 * margin)
   centerY = minY + margin + Rnd * (maxY - minY - 2 * margin)

   ' Generate random points around a circle with varying radii
   numPoints = 16 + Int(Rnd * 16)  ' Between 16 and 32 points

   ' Base radius (smaller of the two dimensions)
   If (maxX - minX) < (maxY - minY) Then
       baseRadius = (maxX - minX) / 3
   Else
       baseRadius = (maxY - minY) / 3
   End If

   ' Generate points at regular angular intervals with random radius variations
   For i = 0 To numPoints - 1
       angle = (i * 2 * 3.14159265) / numPoints

       ' Random radius variation creates convex and concave sections
       radiusVariation = 0.5 + Rnd * 0.8  ' Varies from 0.5 to 1.3 times base
       radius = baseRadius * radiusVariation

       ' Calculate point position
       pointX(i) = Int(centerX + radius * Cos(angle))
       pointY(i) = Int(centerY + radius * Sin(angle))
   Next i

   ' Draw the closed shape by connecting all points
   For i = 0 To numPoints - 1
       ' Get current and next point (wrap around to close the shape)
       x1 = pointX(i)
       y1 = pointY(i)

       If i = numPoints - 1 Then
           x2 = pointX(0)  ' Connect last point back to first
           y2 = pointY(0)
       Else
           x2 = pointX(i + 1)
           y2 = pointY(i + 1)
       End If

       ' Draw line between points using Bresenham's algorithm
       dx = Abs(x2 - x1)
       dy = Abs(y2 - y1)

       If x1 < x2 Then
           sx = 1
       Else
           sx = -1
       End If

       If y1 < y2 Then
           sy = 1
       Else
           sy = -1
       End If

       err = dx - dy
       px = x1
       py = y1

       Do
           ' Draw pixel
           Pixel px, py, RGB(WHITE)

           ' Check if we've reached the end point
           If px = x2 And py = y2 Then Exit Do

           ' Calculate next point
           e2 = 2 * err

           If e2 > -dy Then
               err = err - dy
               px = px + sx
           End If

           If e2 < dx Then
               err = err + dx
               py = py + sy
           End If
       Loop
   Next i

   ' Find a point inside the shape (use center as it's always inside)
   x% = Int(centerX)
   y% = Int(centerY)

   ' Verify it's not on the boundary by checking if it's a white pixel
   ' If it is, offset slightly
   foundInside = 0
   Do While foundInside = 0
       If Pixel(x%, y%) <> RGB(WHITE) Then
           foundInside = 1
       Else
           ' Move slightly in a random direction
           x% = x% + Int(Rnd * 5) - 2
           y% = y% + Int(Rnd * 5) - 2
       End If
   Loop
End Sub
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2777
Posted: 11:29am 10 Oct 2025
Copy link to clipboard 
Print this post

Searching for PicoMiteRP2040V6.01.00RC0.uf2 but missing from .zip.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 12:37pm 10 Oct 2025
Copy link to clipboard 
Print this post

PicoMiteV6.01.00RC0.zip
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 02:41pm 10 Oct 2025
Copy link to clipboard 
Print this post

Minor update to RC0 to fix colours in the fill command, increase speed on non-buffered displays and reduce the memory footprint coming soon
Edited 2025-10-11 00:55 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 04:18pm 10 Oct 2025
Copy link to clipboard 
Print this post

Improved fill command

PicoMiteV6.01.00RC0.zip

if you want a random colour on a VGA system that isn't black use
Map(Min(Rnd*15+1,15))
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 613
Posted: 05:08pm 10 Oct 2025
Copy link to clipboard 
Print this post

Many thanks for the circle fix. Maybe one more:
circle -20,500,50,5,,rgb(green),rgb(red)


If it is printed in parts out of bounds, the first line of pixels will be overwritten with the colour of the outside drawn content


Edit:
If polygons are printed in parts out of bounds, as soon as hres/vres is exceeded with one of the corner coordinates the borderline and the filling "will get out of sync". The filling seems to stay correct but not bc. Observed with framebuffer
Edited 2025-10-11 03:25 by dddns
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 05:32pm 10 Oct 2025
Copy link to clipboard 
Print this post

This is the same for all drawing commands. The firmware locks any out of bounds pixels to the edge. This has always been the case and is part of every driver for every device so I'm sorry but not something to be changed any time soon
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 613
Posted: 05:59pm 10 Oct 2025
Copy link to clipboard 
Print this post

Thanks for the answer! I can work around.. not an issue
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 380
Posted: 07:03pm 10 Oct 2025
Copy link to clipboard 
Print this post

Peter,
just tried to load WebMiteRP2350V6.01.00RC0.uf2 to a brand new Pico 2 W module. It seemed to load, but after loading the explorer opened again and showed the content as being still INDEX.HTM and INFO_UF2.TXT. No port became available in MMCC.

Tried 3 times with clear_flash.uf2 first. No success.

Tried then with WebMiteRP2350V6.01.00b14.uf2 and all worked OK. Still after that tried agin with RC0 without success.

Seems to something odd with RC0 (or with me   )?

Pluto
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 09:45pm 10 Oct 2025
Copy link to clipboard 
Print this post

Thanks for the report - I;ll look at it
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 07:47am 11 Oct 2025
Copy link to clipboard 
Print this post

Try this

WebMiteRP2350V6.01.00RC0.zip
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 380
Posted: 11:48am 11 Oct 2025
Copy link to clipboard 
Print this post

Thanks! Now it is OK and connects to MMCC and to WiFi.  
Pluto
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2958
Posted: 12:30pm 11 Oct 2025
Copy link to clipboard 
Print this post

Hi Peter,

Issue with GUI TEST LCDPANEL hanging when SD card inserted in SD socket.

Am seeing this on official RPi Pico 2 and on your 64 pin module when using firmware versions RP2350 standard and USB (not tried other versions such as HDMI, VGA, Webmite etc).

Have a WaveShare 3.5" FT7796S display module containing SD socket. ALL things work as should do (i.e. can read/write SD card, and all things on display work nicely.
Without an SD card inserted, GUI TEST LCDPANEL works well. But if this is in the midst of drawing circles and an SD card is inserted, then it hangs the display (but not the PicoMite).
Likewise, if an SD card is inserted prior to GUI TEST LCDPANEL, then it attempts the first circle but then hangs the display.

Options set as:
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION PICO OFF
OPTION CPUSPEED (KHz) 150000
OPTION LCDPANEL ST7796S, LANDSCAPE,GP15,GP14,GP13,GP12,INVERT
OPTION SDCARD GP22

Must stress that everything works as expected apart from using GUI TEST LCDPANEL with an SD card inserted.

Obviously shared SPI Clk, MOSI, and MISO, but the LCD and the SD have own dedicated CS pins (and defined as per OPTIONS above).

Is there anything I am doing wrong - i.e. better to use a different CS GPxx pin for either?

EDIT - This is not just on RC0, but also for previous lot of Betas tested from circa 10 (not used this hardware setup before this).
Edited 2025-10-11 22:34 by WhiteWizzard
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2777
Posted: 09:10pm 11 Oct 2025
Copy link to clipboard 
Print this post

Another data point.
No problem on PicoMite MMBasic RP2040 V6.01.00b20 with LCDPANEL ST7796S.

I vaguely recall (long ago) Peter saying the SD_CS pin isn't used when checking for the presence of an SD card. How often it does this I don't know but perhaps it is connected to the issue.

Another thing to test would be a Basic program that does the same as GUI TEST LCDPANEL.
If normal use of the display isn't affected it is less of an issue.

eg copy this to the command line.
c=2^24-1:do:circle mm.hres*rnd, mm.vres*rnd, mm.vres*rnd*.3,,,0,rnd*c :loop


Edit.
Updated to RC0 and still no problem on RP2040.
Edited 2025-10-12 11:00 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8199
Posted: 07:12am 12 Oct 2025
Copy link to clipboard 
Print this post

CS isn't used on parallel LCD displays, it's tied low to keep them enabled.
SPI devices *always* use their individual CS pins. The CS pins are the only isolation between devices on the SPI bus.
What The SD card doesn't use in MMBasic is the card presence switch. MMBasic attempts to read MISO using the SD_CS pin every few seconds and errors if it isn't found.

Those options look ok to me and I can't see any obvious problem. At a guess it's something to do with timing on the SPI bus.

Remember that GUI TEST LCDPANEL runs a MMBasic program. Any messages to console triggered by inserting or removing the SDcard will also try to write to the display, as that is the default setting.
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 08:21am 12 Oct 2025
Copy link to clipboard 
Print this post

  Quote  Is there anything I am doing wrong

Not enabling touch, leaving touch CS dangling?
Edited 2025-10-12 18:21 by matherp
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2958
Posted: 09:02am 12 Oct 2025
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Is there anything I am doing wrong

Not enabling touch, leaving touch CS dangling?

I’m using capacitive touch display accessed via I2C.
All other display functions run flawlessly whether SD card inserted or not (and also work when card inserted or removed), it’s just GUI TEST LCDPANEL that ‘hangs’ the display.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 09:43am 12 Oct 2025
Copy link to clipboard 
Print this post

No idea then and haven't got one of those displays. Certainly on an ILI9341 there is no issue and I can play a FLAC from the SD while running gui test lcdpanel. Something electrical on that display possibly? Marginal power supply? etc.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10486
Posted: 09:50am 12 Oct 2025
Copy link to clipboard 
Print this post

Ignore - will update
Edited 2025-10-12 20:03 by matherp
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 264
Posted: 12:05pm 12 Oct 2025
Copy link to clipboard 
Print this post

Hi Peter,

I installed the latest release firmware (PicoMiteRP2350V6.01.00RC0.uf2) on my robot and it runs fine - thanks a lot!

Best
Thomas

Only a minor thing: I spend a few hours thinking there was a problem with LCD drivers in the release version until I realized that when I restored the options (from disk) written with a different firmware version (here PicoMiteRP2350V6.01.00b17.uf2 vs PicoMiteRP2350V6.01.00RC0.uf2), a different LCD display setting was restored (LCDPANEL ST7789_320BUFF vs. ILI9488BUFF). Since there was no error, I did not check if the setting was correct ... But I guess that's only a problem when switching between major firmware versions.
 
     Page 1 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025