Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:11 06 Jun 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 : MMBasic V6.03.00 release candidates

     Page 13 of 20    
Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3268
Posted: 05:23am 27 May 2026
Copy link to clipboard 
Print this post

At the end of the program perhaps:-
END "OPTION HEARTBEAT ON"
  Quote  END [noend] or END cmd$
End the running program and return to the command prompt. If a subroutine named MM.END exists in the program it will be executed whenever the program ends with an actual or implied END command. It is not executed if the program ends with the break character (ie, Ctrl-C).
The optional parameter ‘noend’ can be used to block execution of the MM.END subroutine eg, “END noend”
if 'cmd$' is specified then it will be executed as though at the command prompt after the program finishes. Note: if "END cmd$" is used but a subroutine MM.END exists it will be executed and cmd$ ignored.
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 81
Posted: 03:09pm 27 May 2026
Copy link to clipboard 
Print this post

Hi,
can I ask what about the current status of the Shared Memory functions?

I can't seem to get that working at between two RP2350A devices.
FW is PicoMiteHDMI MMBasic RP2350A Edition V6.03.00RC10

The connection is established but no data is transfered.
> list pins
GP0      1      OFF: Reserved for function
GP1      2      OFF: Reserved for function
GP2      4      OFF: Reserved for function
GP3      5      OFF: Reserved for function
GP4      6      OFF: Reserved for function
GP5      7      OFF: Reserved for function
GP6      9      OFF: Reserved for function
GP7      10     OFF: Reserved for function
GP22     29     OFF: Reserved for function

I used the demo program from the forum where one device does a gui test lcdpanel and the example from "MEMORY_SHARE_User_Manual.pdf"
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11435
Posted: 03:15pm 27 May 2026
Copy link to clipboard 
Print this post

It should work but I haven't tested recently. Are both RP2350s running at the same cpu speed?.
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 81
Posted: 03:18pm 27 May 2026
Copy link to clipboard 
Print this post

  matherp said  It should work but I haven't tested recently. Are both RP2350s running at the same cpu speed?.


Yes, they do:
Host:
> option list
PicoMiteHDMI MMBasic RP2350A Edition V6.03.00RC10
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION PICO OFF
OPTION RESOLUTION 640x480 @ 252000KHz

Client:
> option list
PicoMiteHDMI MMBasic RP2350A Edition V6.03.00RC12
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION RESOLUTION 640x480 @ 252000KHz
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11435
Posted: 03:21pm 27 May 2026
Copy link to clipboard 
Print this post

V6.03.00RC14
PicoMiteRP2040V6.03.00RC14.zip
PicoMiteRP2350V6.03.00RC14.zip

Add USB touch support. Should work on any USB build but obviously really makes sense for VGAUSB and HDMIUSB builds.
If you have the screen and a USB build please test and let me know if it works on your display.
Use the normal TOUCH(X), TOUCH(Y), TOUCH(UP), TOUCH(DOWN) functions to interrogate the screen. Later I will add support for multi-touch reporting and possibly limited gesture support.
Edited 2026-05-28 01:27 by matherp
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 508
Posted: 04:02pm 27 May 2026
Copy link to clipboard 
Print this post

Peter,

the Webmite 2350 is still not running, after flash comes up with

WebMite MMBasic RP2350A Edition V6.03.00RC14
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

[CYW43] error: hdr mismatch 0300 ^ feff

a few times and then loops with an error

[CYW43] STALL(0;1-1): timeout


Gerald
                                                                 
73 de OE1HGA, Gerald
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 757
Posted: 04:30pm 27 May 2026
Copy link to clipboard 
Print this post

Hi Peter,

there are some problems with the editor on the resolution 720 (HDMI) others are not tested.

I also tested the GUI Touch function with my china 7" "no name" touch display. It is properly recognized and works just perfect! I LOVE this option!

I uploaded a video to my Dropbox, you can see the GUI working with touch and the editor problem (in the end) + my "OPTION LIST".

Video  (dropbox)

Again: It is wonderful to have a combination of HDMI / VGA and Touch, as well as GUI with Mouse!

Greetings
Daniel
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 508
Posted: 04:31pm 27 May 2026
Copy link to clipboard 
Print this post

Peter,

there is still a minor but annoying bug with the LINE command:

e.g. on a 320x240 display the command

LINE 100,100,300,400

produces a line as expected but anlong the bottom (highest Y-value) border there are dots drawn as artefacts. This only happens with linewidth 1. Does not happen with e.g. LINE 100,100,400,400 or other 45 degree lines.

The LINE AA command does not show this artefacts. Lines over any border are cut off cleanly, as far as I found out yet.

Seems to be in any build AFAIK.

Gerald
                                                                 
73 de OE1HGA, Gerald
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 366
Posted: 04:45pm 27 May 2026
Copy link to clipboard 
Print this post

Where can I find the description of the base$( function?
This may have been added with V6.03.00RC12, or have I possibly missed something?

Jan.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11435
Posted: 05:55pm 27 May 2026
Copy link to clipboard 
Print this post

  Quote  LINE 100,100,300,400

produces a line as expected but anlong the bottom (highest Y-value) border there are dots drawn as artefacts. This only happens with linewidth 1. Does not happen with e.g. LINE 100,100,400,400 or other 45 degree lines.


This is what it has always done in all versions of MMbasic AFAIK. The code caps the x and y at MM.HRES/MM.VRES-1. The question has been asked and answered multiple times before. It would be a huge change to fix as every display driver does the same thing and there are dozens of them.

there are some problems with the editor on the resolution 720 (HDMI) others are not tested.

The system has an algorithm which decides which status line to used based on screen width - looks like it needs improvement.

  Quote  I also tested the GUI Touch function with my china 7" "no name" touch display. It is properly recognized and works just perfect! I LOVE this option!



  Quote  the Webmite 2350 is still not running, after flash comes up with

The Pimoroni Pico Plus 2W works perfectly (without psram enabled) so it can't be anything too difficult but I can't test/diagnose until after Wednesday next week when I have access to a normal Pico-2W
Edited 2026-05-28 03:58 by matherp
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 647
Posted: 08:06pm 27 May 2026
Copy link to clipboard 
Print this post

  JanVolk said  Where can I find the description of the base$( function?
This may have been added with V6.03.00RC12, or have I possibly missed something?

Jan.


It's not an official definition but I played around with it and came up with this:

BASE$(base,number)
converts a number in base 10 to the specified base.
Base must be in range 2 to 36


Example:

? BASE$(2,6300)
1001110110

? BASE$(16,157)
9D

To quickly change from base 2, 8 or 16 to another base:

? BASE$(16,VAL(&O77)) Convert from base 8 to base 16
3F
Edited 2026-05-28 06:31 by toml_12953
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 508
Posted: 10:56pm 27 May 2026
Copy link to clipboard 
Print this post

  matherp said  This is what it has always done in all versions of MMbasic AFAIK. The code caps the x and y at MM.HRES/MM.VRES-1. The question has been asked and answered multiple times before. It would be a huge change to fix as every display driver does the same thing and there are dozens of them.


true, but my hope was it would be easy to solve as it only occurs with linewidth=1
                                                                 
73 de OE1HGA, Gerald
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1174
Posted: 05:45pm 28 May 2026
Copy link to clipboard 
Print this post

  ville56 said  
  matherp said  This is what it has always done in all versions of MMbasic AFAIK.


true, but my hope was it would be easy to solve as it only occurs with linewidth=1

The CMM2 doesn't move off-screen pixels from lines and draw them on the edge of the screen. Instead, they never appear. This can result in confusion if you unintentionally draw lines off-screen and see no results - it appears as a bug in the MMBasic firmware, and not in your own code.

If you are curious, here are some of the routines that are used as the low-level code to put pixels on the various displays. (There are more in other files.) All of these, except for the one noted in "SPI-LCD.c", clamp the x & y coordinates to the screen. Also, I only saw one routine that uses a "clamp()" function - all the rest have in-line code. That's a lot of instances that would need changing. Curiously, the circle command is not affected.

Draw.c
void DrawRectangle555(int x1, int y1, int x2, int y2, int c)
void DrawRectangle256(int x1, int y1, int x2, int y2, int c)
void DrawRectangle2(int x1, int y1, int x2, int y2, int c)
void MIPS16 DrawRectangleUser(int x1, int y1, int x2, int y2, int c)

SSD1963.c
void DrawRectangleSSD1963(int x1, int y1, int x2, int y2, int c)

SPI-LCD.c
void DrawRectangleSPI(int x1, int y1, int x2, int y2, int c) // doesn't clamp pixels
void DrawRectangleSPISCR(int x1, int y1, int x2, int y2, int c)
void DrawRectangleMEM(int x1, int y1, int x2, int y2, int c)
void DrawRectangleMEM332(int x1, int y1, int x2, int y2, int c) // uses clamp()

Visit Vegipete's *Mite Library for cool programs.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5902
Posted: 06:52am 29 May 2026
Copy link to clipboard 
Print this post

Peter,

I still have not come closer to the PIO "not working" issue in MINI600300rc9. I checked all registers of the PIO for initialization failures (such as &h50300008, even modified some during PIO running, to get to a solution. But have no clue yet. And the pattern is consistent.

A new pico (hardware) shows the problem, and after some diagnosis, PIO starts working, and that pico is "repaired". It never shows the problem anymore. And I am running out of virgin pico's. I tried converting a repaired one back to an older version, nuke flash, and re-install 60300rc9. But the pico keeps working (as far as I have tested).

I have seen this on
- GEEK (has OPTION PICO OFF)
- Pico zero (has OPTION PICO OFF) 3x
- RP2040 Game*Mite with genuine RP2040 pico
- Bare RP2040 boards (2x)

I will do a test soon with RC14 (hoping it accidentally fixed) since I have one more genuine Pico Zero.

Volhout

P.S. could it be related to some speed optimizations in MINI60300rc9, where PIO FIFO becomes cached ? But how can it "repair". No idea.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

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

Harm, please post a program that demonstrates the problem. I think I have a virgin pico at home. Does it happen on rp2040 and rp2350 or only one? Is it only on PICOMITEMIN or normal PICOMITE as well?
Edited 2026-05-29 18:40 by matherp
 
mozzie
Guru

Joined: 15/06/2020
Location: Australia
Posts: 370
Posted: 04:34pm 29 May 2026
Copy link to clipboard 
Print this post

G'day Peter,
Some quick testing with a Pico Computer USB-HDMI-Mk1 and 7" HDMI / CAP touch, the following message is displayed on plugging it in:

> Multi-touch Screen Connected on channel 4 (10 contacts, 1024x600)

But no touch is registered with the following code:

'prog to test USB touch

Option default integer

GUI Cursor on
GUI Cursor Link Mouse
GUI interrupt TouchDown,TouchUp

Do
 If Touch(down)=1 Then
   Print Touch(x),Touch(y)
 EndIf
Loop Until Inkey$<>""

End

Sub TouchDown
 Print "Touched"
End Sub

Sub TouchUp
 Print "Untouched"
End Sub


The keyboard and mouse work as expected and the mouse buttons generate interrupts / touch events.

Display is WaveShare 70H-1024600-QLED-CT-B (SKU22684) 7" 1024x600 5 point cap touch, unfortunately they don't specify the touch chip in the online data and it is buried under tape on the board. Not sure why it is reporting 10 point touch when only advertised as 5 point? Is there any way we can interrogate from the PicoMite? This unit works fine plugged into my WIN7-32bit PC.

> option list
PicoMiteHDMI MMBasic USB RP2350A Edition V6.03.00RC14
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION MOUSE SENSITIVITY     1.0000
OPTION KEYBOARD US
OPTION RESOLUTION 1024x768 @ 375000KHz
OPTION DISPLAY 32, 64
OPTION GUI CONTROLS 96
OPTION DEFAULT FONT 3, 1
>


Away driving trucks again for the next 2 days so may not be able to test further until Monday.

Regards, Lyle.
 
terekgabor
Regular Member

Joined: 02/01/2026
Location: Hungary
Posts: 90
Posted: 06:42pm 29 May 2026
Copy link to clipboard 
Print this post

Hello!

Is there any way to use GP25 (heartbeat) as a normal output with Webmite? I read not, but what is the reason? Can somehow solve it?

Thx,
G@bor
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5902
Posted: 07:17pm 29 May 2026
Copy link to clipboard 
Print this post

@Peter,

Just tested the last Pico Zero with 2040_V60300 MIN rc14.
After programming, load following program.

On terminal, it should show 0's until you connect a quadrature encoder signal to GP0/GP1.
In stead it shows a random number, and with encoder connected, it does not increment.

The set to zero is by executing directly a PIO command in SM0, while the program is running.

It feels a bit as if the PIO program is not running at all. A running program would constantly shift data in FIFO. Note: this PIO program runs from address &h10 (not zero).

In case you connect a stepper motor to GP2...5 (direct drive the 4 coils with an ULN2003) it follows the rotary encoder changes.



 Option default integer

 'system initialisation -------------------------------------------------------

 'init the stepper control pins
 initio

 ' variables for stepper
 Dim phases(7)=(&b0001,&b0011,&b0010,&b0110,&b0100,&b1100,&b1000,&b1001)
 Dim steps2go=0, quadra, quadra_old, delta

 'set the max speed of the stepper at 1ms per step (1kHz)
 SetTick 1,step_it


 'program PIO 1
 program_PIO 'program the code in PIO 1

 'start quadrature decoder
 start_sm0 'start decoder on GP0 and GP1
 zero_sm0  'zero quadrature



 'main program loop --------------------------------------------------------

 Do
   'read PIO FIFO for quadrature changes
   quadra = read_fifo(0)

   'debug
   print str$(quadra,12,0)   'get data from decoder

   'add delta fifo since last read to stes2go (pos or neg)
   delta=quadra_old-quadra:quadra_old=quadra
   Inc steps2go,delta*8                        '8 = software gain

   'add delta fifo to servo pos

   'send delta to UART

   Pause 100
 Loop While Inkey$=""

 PIO stop 1,0
 PIO clear 1

End



 ' subroutines ---------------------------------------------------------------

 'zero counter state machine 0
Sub zero_sm0

 PIO execute 1,0,&hA023 '= assembly "mov X, null" (zero X reg)

End Sub


 'this function returns the actual count of decoder n
Function read_fifo(n) As integer

 Local dat%(3)
 PIO read 1,n,4,dat%()                                   'read whole fifo
 read_fifo = dat%(3)                                    'last data in fifo
 If read_fifo>2147483647 Then Inc read_fifo,-4294967296 '2'th complement

End Function


 'this subroutine programs the quadrature decoder program for PIO1 into PIO program memory
Sub program_PIO

 'this is the PIO program in machine code
 dim p%(7)=(&h001A00170015001A,&h0015001A001A0017,&h0017001A001A0015, &h001A00150017001A,&h4042A0404042A0C3,&hA029001A005AA0A6,&h8000A0C1A0290059,0)

 'here the program is programmed in memory
 PIO program 1,p%()

 wrap=27           'end of the program
 wrp_tgt=16        'start of the program loop

End Sub


 'this subroutine starts state machine 0 quadrature decoder on gp12 and gp13
Sub start_sm0

 'uses GP0,GP1, assign pins in MMBasic
 SetPin gp0,pio1
 SetPin gp1,pio1

 'quadrature decoders generic settings
 PIO_f%=63e6                            'frequency = 63MHz
 PIO_s%=0                               'shift register (shift in left)
 PIO_e%=Pio(execctrl gp0,wrp_tgt,wrap)  'start and stop of the loop

 'assign pins in PIO
 pin_sm0%=Pio(pinctrl 0,0,0,gp0)

 'configure and start PIO
 PIO init machine 1,0,PIO_f%,pin_sm0%,PIO_e%,PIO_s%,wrp_tgt
 PIO start 1,0

End Sub

 'inits stepper output signals on GP2...5
Sub initio

 'init stepper pins to dout and low
 For i=2 To 5
   SetPin "GP"+Str$(i),dout :Pin("gP"+Str$(i))=0
 Next

End Sub


 'moves the stepper until step2go is zero
Sub step_it
 Static ps=0
 Local dn

 If steps2go<>0 Then
   Inc steps2go,Choice(steps2go<0,1,-1)
   dn=Choice(steps2go<0,7,1)
   Inc ps,dn:ps=ps Mod 8
   Port(GP2,4)=phases(ps)
 End If

End Sub


The code may look more complex than needed, but it is because the quadrature was stolen from the 4 encoder software for Phenix.

Up to now I have not fiddled with this Pico Zero, so it still fails. Some of the failing pico's I have programmed with V60201 release, and then it all works.

Volhout.

P.S. Just checked, the normal 2040 V60300 rc14 works fine. It is just the MIN version. And when I go back from the normal version to the MIN version, PIO refuses to work again.
.
.
Edited 2026-05-30 05:29 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11435
Posted: 08:27pm 29 May 2026
Copy link to clipboard 
Print this post

  Quote  Is there any way to use GP25 (heartbeat) as a normal output with Webmite?

No,it is the chip select pin for the CYw43
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11435
Posted: 07:25am 30 May 2026
Copy link to clipboard 
Print this post

Lyle
Later today I'll post a version with some added diagnostics. If you could run this and capture the output that should help to understand why the Waveshare is misbehaving. The way the code works is to read the report descriptor of the device and then use that to interpret the actual touch reports. This tries to be general but is obviously missing something. Unlike for a I2C or SPI touch chip, the actual touch chip shouldn't matter because the report descriptor should give the firmware the information it needs to correctly decode the position reports
 
     Page 13 of 20    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026