Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:18 27 Mar 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 V6.02.01 release candidates

     Page 9 of 9    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 06:37pm 22 Mar 2026
Copy link to clipboard 
Print this post

V6.02.01RC9

PicoMiteV6.02.01RC9.zip

Minor performance improvement for RP2350 versions (2-3%)
Fixes bug in MEMORY INPUT
Adds support for user configuration of stepper enable after estop
Adds PEEK(STEPPER BUFFER) which will return the number of free slots in the gcode buffer
Stepper_Reference.pdf
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 327
Posted: 08:55pm 22 Mar 2026
Copy link to clipboard 
Print this post

PEEK(STEPPER BUFFER) is missing from the latest Stepper Reference manual.

Jan.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 10:45pm 22 Mar 2026
Copy link to clipboard 
Print this post

Stepper_Reference.pdf
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 241
Posted: 03:25am 23 Mar 2026
Copy link to clipboard 
Print this post

G'day Peter,
Would one further enhancement be possible?

There is currently no easy way I can see to know if the Stepper system is idle but initialized in the background, except peeking a register and checking for an error.

Could peek(stepper active) be made to return -1 (or some other value) if the stepper system is not initialised?

Regards,
Lyle.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 10:16am 23 Mar 2026
Copy link to clipboard 
Print this post

  Quote  Could peek(stepper active) be made to return -1 (or some other value) if the stepper system is not initialised?

Will do.

All:
With that trivial change RC9 will be the release. So let me know any issues or it will be too late as of tomorrow evening UK time
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 439
Posted: 10:27am 23 Mar 2026
Copy link to clipboard 
Print this post

Peter,

is the issue with one element arrays now fixed?

Option base 1
Dim i%(1)
Error: dimensions
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 10:37am 23 Mar 2026
Copy link to clipboard 
Print this post

This is how MMBasic works, will never be "fixed"
Each MMbasic variable has a table Dims[] that holds the dimensions of the array. So a two dimensional array with 4 elements in the first dimension and 2 in the second would have 4 in dims[0] and 2 in dims[1]. A "0" in dims[0] is the universal test in MMBasic for a scalar variable rather than an array. Changing this would be a massive change and would inevitably de-stabilise the entire interpreter.
Edited 2026-03-23 21:06 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5815
Posted: 12:35pm 23 Mar 2026
Copy link to clipboard 
Print this post

Peter,

RC8 was okay for 2040 VGA, 2040 GM, 2350 GM. I do not have time to redo all tests for RC9 that fast.

Volhout
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4285
Posted: 04:39pm 23 Mar 2026
Copy link to clipboard 
Print this post

  ville56 said  Peter,

is the issue with one element arrays now fixed?

Option base 1
Dim i%(1)
Error: dimensions

  matherp said  This is how MMBasic works, will never be "fixed"
Each MMbasic variable has a table Dims[] that holds the dimensions of the array. So a two dimensional array with 4 elements in the first dimension and 2 in the second would have 4 in dims[0] and 2 in dims[1]. A "0" in dims[0] is the universal test in MMBasic for a scalar variable rather than an array. Changing this would be a massive change and would inevitably de-stabilise the entire interpreter.

That's fine, but doesn't seem to explain why the code shown is not OK.

You'd expect an array of one element, referred to as i%(1).

Internally dims[0] would presumably be 1.  What's the problem?

edit: for completeness, using i%(0) would be an error of course

John
Edited 2026-03-24 02:40 by JohnS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 04:50pm 23 Mar 2026
Copy link to clipboard 
Print this post

Because the value stored in dims is the highest index value for the array minus OPTION BASE. This code is in every version of MMbasic and won't be changing.
DIM a(2) stores 1 because you can't use a(2). I was simplifying in the explanation above to make it easier to understand without getting into the compexities of OPTION BASE
Edited 2026-03-24 02:52 by matherp
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4285
Posted: 05:23pm 23 Mar 2026
Copy link to clipboard 
Print this post

Ah. No worries, in that case, better just to live with it.

Maybe a few words in the manual, under DIM, when option base is 1.

John
Edited 2026-03-24 03:24 by JohnS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8696
Posted: 06:09pm 23 Mar 2026
Copy link to clipboard 
Print this post

Just don't use base 1. :)  It uses the same space anyway, whether you use (0) or not. It's still there, just not accessible.
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 06:21pm 23 Mar 2026
Copy link to clipboard 
Print this post

Not true. DIM a(2) with OPTION BASE 1 uses exactly the same ram as DIM a(1) with option base 0. The zero slot for option base 1 is not there. OPTION BASE is just subtracted from the index so internally the firmware doesn't care
Edited 2026-03-24 04:22 by matherp
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 439
Posted: 06:25pm 23 Mar 2026
Copy link to clipboard 
Print this post

  matherp said  
... DIM a(2) stores 1 because you can't use a(2).


sure you can use a(2) ... in both cases, base 0 and base 1

> option base 1
> dim integer a(2)
> print a(1)
0
> print a(2)
0
>
-------------------------

> option base 0
> dim integer a(2)
> print a(0)
0
> print a(1)
0
> print a(2)
0
>

with base 0 it just generates one index too much, in this case a(2).
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11109
Posted: 06:54pm 23 Mar 2026
Copy link to clipboard 
Print this post

I'm talking about the internal C array dim[] that stores the size of each array index. When with OPTION BASE 1 when you specify DIM a(2) then the internal array dim has a 1 in it indicating that the maximum internal index is 1 to which is added OPTION BASE for input and output. In any case the point of the discussion is to try and explain why DIM a(1) as a basic statement with OPTION BASE 1 and DIM a(0) with option base 0 will never and can never be allowed.
Just to be clear, this is nothing to do with my likes or dislikes it is core MMbasic from day 1. I would love to be able to specify arrays with a single element as it would make some of the maths array functionality much easier but it simply can't be done without a major rewrite.
Edited 2026-03-24 05:04 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8696
Posted: 08:30pm 23 Mar 2026
Copy link to clipboard 
Print this post

It's a neat system though. It doesn't appear to work anything like the old BASIC interpreters, probably because it's written in C. :)
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 4285
Posted: 09:06pm 23 Mar 2026
Copy link to clipboard 
Print this post

I don't see it as a C issue, which could do anything you like, except in this case I gather it's a kind of an accident of the implementation from, well, day one.

If it had been a problem in that early time maybe it would have been changed?  Anyway, we are where we are and ... it's not a big thing to live with!

Languages / their implementations commonly have some odd things (C's preprocessor is fun, the pointer syntax is er, fun, python's __ is bizarre, C++ er, enough said, and so on).

John
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 327
Posted: 09:28pm 23 Mar 2026
Copy link to clipboard 
Print this post

> run
Stepper initialized - 100KHz timer active
Warning: Soft limits not configured. Use STEPPER LIMITS to set working area.
Stepper armed - executing buffered commands

I loaded FishFeeder.bas and the firmware PicoMiteRP2350V6.02.01RC9 and started it, after which I received the above message.
I tried various Stepper limits but the message persists.
Which command ensures that I no longer receive the message on a terminal when I use a separate stepper motor without limit switches, or am I doing something wrong?

Jan.
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 1786
Posted: 09:38pm 23 Mar 2026
Copy link to clipboard 
Print this post

I've had a look at all this stepper code to use but as there are direction and pulse pins what is the hardware to use that pulse the stepper motor ?

Now there are two flavours of steppers bipolar and unipolar so which is one is used with this.

Now I do have those 2 new stepper motors which are bipolar and I'm on changing my old Macson surface grinder to use steppers as backlash on the down travel where the the grinding wheel is doing 15,000rpm can't be present.

Maybe a new thread should be made where the stepper code for MMBasic can be made where all the hardware is shown along with an easy guide to get it all going.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3089
Posted: 10:36pm 23 Mar 2026
Copy link to clipboard 
Print this post

Bryan1, have added some info to the fish feeder thread.
 
     Page 9 of 9    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026