Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:58 21 Oct 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 : PicoMite MMbasic V7.00.00 betas:  

     Page 3 of 6    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 06:48pm 02 Oct 2026
Copy link to clipboard 
Print this post

Version V7.00.00b4 is now available at https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V7.0.00b4
This includes more optimisation for the rp2350 and increased user heap for the rp2350 as well as fixing the bugs identified above

Volhout: try la_24_2 on this at 378MHz and have a look at the cycle time.
 
hhtg1968
Senior Member

Joined: 25/05/2023
Location: Germany
Posts: 247
Posted: 09:00pm 02 Oct 2026
Copy link to clipboard 
Print this post

I do not close the housing of my pico 3 any longer...

one beta after the other. but it is so cool to test...
 
karlelch

Guru

Joined: 30/10/2014
Location: Germany
Posts: 361
Posted: 10:23am 03 Oct 2026
Copy link to clipboard 
Print this post

Thanks for the new version, Peter!

I tested Version V7.00.00b4 with my current robot control software (running on a standard Pico2W). It does a lot of math, communicates with digital servos via a COM port, and sends servo data via UDP to a host PC. At first glance, I did not find any issues. The increase in speed is small but detectable, but then I tried to optimize the MMBasic code already.

Options
WebMite MMBasic RP2350A Edition V7.0.00b4
OPTION FLASH SIZE 4194304
OPTION LIBRARY_FLASH_SIZE  34000
OPTION COLOURCODE ON
OPTION HEARTBEAT OFF
OPTION CPUSPEED (KHz) 315000
OPTION DISPLAY 64, 80
OPTION WIFI Elchland3, ****************, PICO3A71AD2F089
OPTION PLATFORM walkr|server


Option Compile Off
Run
Loop   0.364 ± 0.659 ms (n=26811, -0.166..9.877)
Exec   8.926 ms (n=45, 8.853..9.015)
Move   9.803 ms (n=47, 9.301..19.398)


Option Compile On
Loop   0.304 ± 0.288 ms (n=61485, -0.190..0.809)
Exec   8.824 ms (n=93, 8.746..8.910)
Move   8.310 ms (n=94, 7.903..17.666)



> ?MM.Info$(compile)
NONE 0 REUSED 4 STMTS 2448 RAN 1442659 MISS 156107 CODE 727922 SIZE 66228 OF 636


[PERF] elapsed=13298965 us  statements=575991  findvar=1288427 (locals=903188 [2
[PERF] top commands by dispatch count:
     210515  Let
     165838  If
      39045  Static
      38715  /*
      37870  Local
      19493  Loop
       4713  Inc
       3883  Cat
       1071  Poke
        838  Math
        558  Print
        207  Pause
         83  Const
         76  For
         57  Dim
         47  Read
         25  WEB
         16  Do
          8  Restore
          7  Select Case
[PERF] top SUBs by exclusive (self) time:
      self_us    incl_us     calls   self_us/call  name
[PERF] top SUBs by call count:
      19290  R._timing
      19290  R.updatePosture
      13361  R.spinGaitGen
        357  ST.sendPacket
        150  R._bodyIK
        150  R._legIK
         48  _update_timing
         36  ST.stopServo
         25  R._computeMove
         25  R._executeMove
         25  R.inputUpdate
         25  R.generateGaitSeq
         25  R.Angles2Pos
         25  R._moveAllServos
         15  ST.waitForStop
          9  R.inputBody
          9  R.inputPosition
          9  R.inputWalk
          4  R.resetInput
          4  R.getServoState



Option Compile Shadow does not report any issues.
Option Compile Shadow
Loop   0.352 ± 0.287 ms (n=20497, -0.147..0.857)
Exec   8.795 ms (n=25, 8.718..8.898)
Move  10.506 ms (n=27, 9.856..19.813)


If someone is interested what the software does: I am building a new hexapod robot now with serial servos. To debug the software and improve the movements before the hardware of the robot is finished, Claude helped me to write some ROS2 software that runs on a PC, receives the servo positions from the MMBasic firmware via UDP and applies them to a model of the robot.

https://youtu.be/L64OecLvrtc

Cheers
Thomas
Edited 2026-10-03 20:29 by karlelch
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 11:31am 03 Oct 2026
Copy link to clipboard 
Print this post

I'm now extending the compiler's capabilities. If you post your code I can analyse it and see what statements aren't being compiled and potentially include them in the next version.
 
karlelch

Guru

Joined: 30/10/2014
Location: Germany
Posts: 361
Posted: 11:49am 03 Oct 2026
Copy link to clipboard 
Print this post

  matherp said  I'm now extending the compiler's capabilities. If you post your code I can analyse it and see what statements aren't being compiled and potentially include them in the next version.

Thanks - the code is in my repository
https://github.com/teuler/walkr-robot/blob/master/code-mmbasic/
`hpx_srv.bas` requires `lib_input.bas` and `lib_st3215.bas` on `A:`. No additional hardware is needed
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2097
Posted: 12:40pm 03 Oct 2026
Copy link to clipboard 
Print this post

Been out of the MMBasic loop for several weeks due to big-panic work issue.

I return to find this amazing insanity  

Haven't found my feet yet but I tested on my RP2350 DIL module and got an immediate ~84% percent speed increase.

For the sake of comparison, what was happening 20,000 times/sec is now 37,000 times/sec with OPTION COMPILE ON.

But here's what shocked me; I used "crunch" in MMEdit IDE and this jumped to 57,000 times/sec  

This has me confused because I would've though that the compiler would have done similar(???)

Edit: Correction 53,000 times/sec.
Edited 2026-10-03 22:44 by PhenixRising
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 05:58pm 03 Oct 2026
Copy link to clipboard 
Print this post

karlech
You use types in your program (good) but you also use normal variables with dots in their names (bad). The compiler doesn't support types and doesn't have the ability to scan the program and work out what is an element of a type and what is a simple variable so it doesn't compile any line which include a dot in a name. As an experiment you could bulk edit the program and see what the performance gain would be.

PhenixRising
The impact of comments and blank lines is a limitation in b4 that will be addressed in b5
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2097
Posted: 06:08pm 03 Oct 2026
Copy link to clipboard 
Print this post

Pete, I am giddy beyond belief.

This development is simply astonishing.

Many thanks X 1,000,000

   
 
Bleep

Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 863
Posted: 06:21pm 03 Oct 2026
Copy link to clipboard 
Print this post

Hi Peter,
Testing various programs, but I've found Chess fails in a very strange way, at a point where it has never had a problem and I can't see anything inherently wrong with it, I've tried giving all the If statements in this Function an EndIf incase that was the problem, but still get the error.
  Quote  PicoMiteHDMI MMBasic USB RP2350A Edition V7.0.00b4
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION KEYBOARD UK
OPTION RESOLUTION 640x480 @ 378000KHz
OPTION DISPLAY 30, 53
OPTION SDCARD GP22, GP2, GP3, GP4
OPTION AUDIO GP10,GP11', ON PWM CHANNEL 5
OPTION RTC AUTO ENABLE
OPTION COMPILE ON
OPTION MODBUFF ENABLE  192
OPTION PLATFORM HDMIUSB
> run
'help' lists commands. TSCP Chess By Tom Kerrigan. Converted MMBasic Ceptimus
bench
[1535] Next i
Error : Cannot find a matching FOR
>

Just run the chess program and then type bench at the prompt.
I get the same error simply playing a game, it sometimes isn't straight away.
Used to work on all previous versions, also works in Fuzix. Because of it's size and complexity, might be a good candidate for your further speed improvements? :-)
Regards Kevin.

chessbas.zip
Edited 2026-10-04 04:24 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 06:58pm 03 Oct 2026
Copy link to clipboard 
Print this post

It is almost certainly running out of stack space. I'll have a look at it. Confirmed - tested on various versions. Is your code recursing more than the original? Do you have the original you can post?
Edited 2026-10-04 05:10 by matherp
 
gadgetjack
Senior Member

Joined: 15/07/2016
Location: United States
Posts: 240
Posted: 07:17pm 03 Oct 2026
Copy link to clipboard 
Print this post

After flashing new firmware , I get "input not supported" on my monitor. This worked good until version 7. Is the start up screen at a higher resolution than it used to be?
Confused....
 
gadgetjack
Senior Member

Joined: 15/07/2016
Location: United States
Posts: 240
Posted: 07:39pm 03 Oct 2026
Copy link to clipboard 
Print this post

update - No version after 6.02 works on hdmi. I had not update for a while. I tried going backwards till it worked again. I tried 3 different monitors in case i had a bad one. Same on all 3.
 
gadgetjack
Senior Member

Joined: 15/07/2016
Location: United States
Posts: 240
Posted: 08:12pm 03 Oct 2026
Copy link to clipboard 
Print this post

Ok , figured it out. I tried my other board and it ran fine. It was the Pimoroni module that would not run it correctly. I guess it was too fast for it. One with the core module runs great. I will stick to the 6.02 version for the other board.
 
Bleep

Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 863
Posted: 05:45am 04 Oct 2026
Copy link to clipboard 
Print this post

Hi Peter,
As far as I remember, no actual changes to the way the code worked were made, so as far as I remember the recursion was the same, originally on the 2040 I reduced the MAX_PLY, and GEN_STACK but now they have been put back to original. When this problem occurred I did try reducing them both again, but there was no difference. I'm away at the moment, so don't have access to my home sytem & I'm not sure I have the "original" here, I'll have a search later today.
Regards Kevin
OK found this, I think it might be original or close.
TSCPChess.zip
Edited 2026-10-04 15:49 by Bleep
 
karlelch

Guru

Joined: 30/10/2014
Location: Germany
Posts: 361
Posted: 07:02am 04 Oct 2026
Copy link to clipboard 
Print this post

  matherp said  karlech
You use types in your program (good) but you also use normal variables with dots in their names (bad). The compiler doesn't support types and doesn't have the ability to scan the program and work out what is an element of a type and what is a simple variable so it doesn't compile any line which include a dot in a name. As an experiment you could bulk edit the program and see what the performance gain would be.

I changed the variable and subroutine names that contain a `.` to `_` - expect the Types, of course. There is an improvement in the computation of the move (from ~8 to ~5 ms per round). Executing the move stays the same, which is not unexpected because here the commands are sent to the servos.

Option Compile Off
Loop   0.330 ± 0.289 ms (n=51368, -0.172..0.867)
Exec   9.326 ms (n=95, 9.268..9.935)
Move   8.538 ms (n=97, 8.145..18.644)


Option Compile On
Loop   0.299 ± 0.551 ms (n=49711, -0.230..9.192)
Exec   8.593 ms (n=61, 8.518..9.017)
Move   5.227 ms (n=63, 5.014..14.190)

[PERF] elapsed=21883715 us  statements=1004857  findvar=2161060 (locals=16050652
[PERF] top commands by dispatch count:
     396749  Let
     149461  /*
     140020  If
     100347  Local
     100037  Static
       9983  Inc
       7053  Cat
       2066  Math
       1059  Poke
        429  Print
        159  Pause
        156  Loop
         83  Const
         63  WEB
         57  Dim
         47  Read
         18  Do
          8  Select Case
          8  Restore
          6  Option
[PERF] top SUBs by exclusive (self) time:
      self_us    incl_us     calls   self_us/call  name
[PERF] top SUBs by call count:
      49712  R__timing
      45595  R_spinGaitGen
        378  R__bodyIK
        378  R__legIK
        353  ST_sendPacket
        124  _update_timing
         63  R__computeMove
         63  R__executeMove
         63  R_inputUpdate
         63  R_generateGaitSeq
         63  R_Angles2Pos
         63  R__moveAllServos
         36  ST_stopServo
         18  ST_waitForStop
         10  R_inputBody
         10  R_inputPosition
         10  R_inputWalk
          4  R_resetInput
          4  R_getServoState
          4  R_logServoState

?MM.Info(Compile)
NONE 1 REUSED 1 STMTS 2453 RAN 2265470 MISS 197226 CODE 1306415 SIZE 77268 OF 66
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 07:48am 04 Oct 2026
Copy link to clipboard 
Print this post

Bleep
I've run diagnostics on the chess program and basically it was always broken and always overran the allocated stack in every build. It just so happens in some builds the stack extended into areas of memory that were benign. I'll have a look at the chess program and see what can be done but on a build with extended stack it ram around 3x faster.

karlelch
Thanks for running the experiment. The performance improvement is good and your printout gives me more areas to look at. Please report again after I post b5 later today or tomorrow.
 
karlelch

Guru

Joined: 30/10/2014
Location: Germany
Posts: 361
Posted: 10:02am 04 Oct 2026
Copy link to clipboard 
Print this post

  matherp said  Thanks for running the experiment. The performance improvement is good and your printout gives me more areas to look at. Please report again after I post b5 later today or tomorrow.

Glad I could help. I am travelling for a week; will be able to test new versions not before the next weekend. But then will happily do so.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 715
Posted: 04:18pm 04 Oct 2026
Copy link to clipboard 
Print this post

  hhtg1968 said  I do not close the housing of my pico 3 any longer...

one beta after the other. but it is so cool to test...


That’s also what I’d like Peter to do if the PC3 is redesigned: move the slide switch from the centre of the motherboard to the front, next to the mini-USB socket  

I’ve been a bit out of the loop due to work and illness, but the adventure can begin again!

Matthias
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1782
Posted: 04:42pm 04 Oct 2026
Copy link to clipboard 
Print this post

  homa said  ... That’s also what I’d like Peter to do if the PC3 is redesigned: move the slide switch from the centre of the motherboard to the front, next to the mini-USB socket   ...

And I would like a jumper header in parallel with the boot button so that an external button can be connected there if needed.
Regards
Michel
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12034
Posted: 05:16pm 04 Oct 2026
Copy link to clipboard 
Print this post

Version V7.00.00b5 is now available at https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V7.0.00b5

More compiler goodness and some bugs fixed - see the release notes. Note Prince of Persia was broken in b3 and b4 but should be working again now
 
     Page 3 of 6    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026