Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:08 05 Jan 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.00 release candidates - Structured types

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10800
Posted: 11:50am 04 Jan 2026
Copy link to clipboard 
Print this post

MMBasic V6.02.00RC0

PicoMiteV6.02.00RC0.zip

6.02.00 introduces the ability for users to create and use structured types in MMBasic. This is fully covered in the structures manual

MMBasic_Structures_Manual.pdf

This version contains the changes identifies in the V6.01.00EXP thread as at EXP7.
In addition it fixes two new bugs identified on the 6.01.00 release thread:

MOUSE SET now sets the wheel position when enabled for a USB mouse
PIO RX interrupt now works for RP2040 (was already OK for RP2350)

It also includes changes to SYSTEM I2C handling to try and avoid background I2C processes (RTC, WII Classic/Nunchuck, I2C keyboard) interacting with foreground I2C operations

Fixes a bug using the SSD1963 buffered drivers when writing to the A: drive

Other stuff from the EXP thread

Fixes bugs in OPTION RESET for a couple of board types
Fixes bug in RAM command usage where a reset would clear the RAM slot
Adds validation to FLASH and RAM commands to stop a lockup when the LOAD subcommand was used on an empty slot
Fixes incorrect naming of VGA222_640 in LIST OPTIONS
Fixes incorrect naming of BLUE_H in LIST PINS
Standardises XMODEM and YMODEM S and S,file$ to always terminate lines with cr/lf. In addition xmodem will now pad with NULL rather than &H1A
Edited 2026-01-04 21:51 by matherp
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 189
Posted: 03:23pm 04 Jan 2026
Copy link to clipboard 
Print this post

G'day Peter,
Many thanks for your work on this new PicoMite version.

Also thanks for the changes to Xmodem and Ymodem, a couple of further observations while testing:
Tested with fresh PicoMiteRP2040 + PicoMiteRP2350V6.01.00EXP7 on WIN7x32-TT4.100, WIN7x32-TT5.5.1, WIN10x64-TT4.106, WIN10x64-TT5.5.1

After many tests they both appear to working better than before with very few hangs (see below)

Ymodem S creates a file "FILE.DAT" on the PC end if file not loaded with name on Picomite, perhaps "File.bas" would be easier to find.

X/Ymodem S removes the CR/LF on the last line, X/Ymodem S "File" does not, however it has been this way since at least MMite 050503 so probably best left as is.

Also might need to add a note in the manual, in big bold letters, perhaps on a page on there own, as to be printed out and stuck above a monitor:

XMODEM R = SEND FILE in Terminal
XMODEM S = RECEIVE FILE in Terminal

The most common reason for xmodem to fail in my experience, is to type Xmodem S and then "send" a file in TeraTerm, or Xmodem R and then "receive" in TeraTerm.
Obviously neither will work but I have done it often enough lately and should know better...

Regards,
Lyle.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8424
Posted: 04:07pm 04 Jan 2026
Copy link to clipboard 
Print this post

Oddly enough, I've very rarely got them mixed up now. :)
As the command is entered on the Pico (not into Tera Term) it is described correctly: XMODEM R is expecting to receive a file. It figures that the terminal is going to have to send it. :)

Of course the commands might be upside down over there. ;)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 113
Posted: 04:36pm 04 Jan 2026
Copy link to clipboard 
Print this post

Hello, Peter
Installed the new version, time to test a bit more. Did a quick test on the mouse set (wheel). Works OK now.
I really appreciate all the work you put into this.

> option list
PicoMiteHDMI MMBasic USB RP2350A Edition V6.02.00RC0
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION MOUSE SENSITIVITY     1.0000
OPTION KEYBOARD US
OPTION RESOLUTION 640x480 @ 252000KHz
OPTION SDCARD GP5, GP6, GP4, GP3

 / Peter63
 
cosmic frog
Guru

Joined: 09/02/2012
Location: United Kingdom
Posts: 306
Posted: 05:16pm 04 Jan 2026
Copy link to clipboard 
Print this post

  mozzie said  

XMODEM R = SEND FILE in Terminal
XMODEM S = RECEIVE FILE in Terminal

The most common reason for xmodem to fail in my experience, is to type Xmodem S and then "send" a file in TeraTerm, or Xmodem R and then "receive" in TeraTerm.
Obviously neither will work but I have done it often enough lately and should know better...


This gets me all the time!

Dave.
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 05:26pm 04 Jan 2026
Copy link to clipboard 
Print this post

  matherp said  MMBasic V6.02.00RC0
...
Other stuff from the EXP thread
...




Before you completely "cast everything in bronze":

Yesterday I was "playing around" (experimenting) with the EXP7...

If you're interested, take the test program "StructParamTest.bas" from your post:

https://www.thebackshed.com/forum/ViewTopic.php?TID=18519&P=6#248986

...and add this starting at line 26:

Dim typeof_people$ = "TPerson"
Call typeof_people$+".Print", people(2)
End


...and be surprised—or not, because you'll predict what would happen...

So, if we had a function 't$=Struct(Typeof, typeVar)' or perhaps even a "generic" 't$=Typeof$(Var)', where Var could also have the type 'integer' or 'string'...
Or even shorter 't$=TOF$(Var)'

You get the idea?

Regards and happy Sunday evening..
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10800
Posted: 05:44pm 04 Jan 2026
Copy link to clipboard 
Print this post

No probs
  Quote  The new TYPE subfunction has been added to fun_struct in Commands.c:6297-6329. The new function:

Syntax: STRUCT(TYPE typename$, element$)
Returns: The base type of the specified element as an integer:
T_INT (0x04) for 64-bit integer
T_NBR (0x01) for floating point number
T_STR (0x02) for string
The implementation follows the same pattern as the existing OFFSET subfunction - it takes a structure type name and element name as string arguments, looks up the structure definition, finds the member, and returns the type masked to only include the base type flags (T_INT | T_NBR | T_STR).
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 06:38pm 04 Jan 2026
Copy link to clipboard 
Print this post

I just tried it with RC0 because I thought you'd already included it as a "hidden feature"...

No, I meant something else:

A function that returns the type as a string, so you can concatenate it with a string constant for the call...

The argument would be an instance of a type and possibly a second optional argument,
where 0 = BaseType and 1 = FullType (difference if it's an array).

For example:

Dim people(2) As TPerson
Dim counters(4) As integer
Dim year As integer


And then:

T$ = Struct(Typeof people(1)) ' -> "TPerson"
T$ = Struct(Typeof people(1), 0) ' -> "TPerson"
T$ = Struct(Typeof people(1), 1) ' -> "TPerson"

T$ = Struct(Typeof people()) ' -> "TPerson"
T$ = Struct(Typeof people(), 0) ' -> "TPerson"
T$ = Struct(Typeof people(), 1) ' -> "TPerson()"


and if we had a "generic" Typeof$() function:

T$ = Typeof$(people(1)) ' -> "TPerson"
T$ = Typeof$(people(1), 0) ' -> "TPerson"
T$ = Typeof$(people(1), 1) ' -> "TPerson"

T$ = Typeof$(people()) ' -> "TPerson"
T$ = Typeof$(people(), 0) ' -> "TPerson"
T$ = Typeof$(people(), 1) ' -> "TPerson()"

' With an ordinary type
T$ = Typeof$(year) ' -> "integer"

T$ = Typeof$(counters(1)) ' -> "integer"
T$ = Typeof$(counters(1), 0) ' -> "integer"
T$ = Typeof$(counters(1), 1) ' -> "integer"

T$ = Typeof$(counters()) ' -> "integer"
T$ = Typeof$(counters(), 0) ' -> "integer"
T$ = Typeof$(counters(), 1) ' -> "integer()"


This would allow binding "methods" to types.

Clear?

But I'm not sure if that's too complex or complicated?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10800
Posted: 06:59pm 04 Jan 2026
Copy link to clipboard 
Print this post

I think that's a step to far  
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 07:47pm 04 Jan 2026
Copy link to clipboard 
Print this post

Yes, you're probably right, and that would be more suitable for a future version, 6.03.00?

Binding 'Methods' in this way might be a "hasty" solution and hardly understandable for most people. It's not very elegant either.

In the meantime, we can let our thoughts wander a bit more until a more mature concept emerges.

I'm already extremely happy that struct types are finally being introduced – that alone opens up some fantastic new possibilities!

---

Addendum:
One "side effect" of my experiments was that I understood how the 'Call()' function can be used, and later even that 'Call' also exists as a command – I had initially overlooked that in the index, being the blind person I am.
Edited 2026-01-05 06:13 by bfwolf
 
damos
Regular Member

Joined: 15/04/2016
Location: Australia
Posts: 79
Posted: 11:21pm 04 Jan 2026
Copy link to clipboard 
Print this post

Thanks Peter,

This has been a long awaited feature for me and greatly expands the projects that I can implement with this platform.

If you get bored and are looking for things to do (no pressure):

- JSON import and export of arrays of structures (unless I missed that one)
- SQLite (maybe C function). Even a basic implementation would be great, but reading tables into structure arrays would be brilliant as entity framework does it that way.

I am currently doing a .Net MAUI project and am forced to use SQLite to get Android and iOS compatibility. It is much better than I thought and the main limitation is it only supports String datatypes for queries (eg int column sorting).

regards
Dan
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9812
Posted: 01:45am 05 Jan 2026
Copy link to clipboard 
Print this post

  cosmic frog said  
  mozzie said  

XMODEM R = SEND FILE in Terminal
XMODEM S = RECEIVE FILE in Terminal

The most common reason for xmodem to fail in my experience, is to type Xmodem S and then "send" a file in TeraTerm, or Xmodem R and then "receive" in TeraTerm.
Obviously neither will work but I have done it often enough lately and should know better...


This gets me all the time!

Dave.


"Right then, I just hook up this RS232 line, and it's TXD.......with respect to what end of the link again?"

I adopted the TXO and RXI type notation on my silkscreens to help clarify.

You're talking about XMODEM, but the confusion is the same!  

I find myself always triple-checking any serial links I design onto a PCB, cos it is SO EASY to get them round the wrong way, then the PCB won't work(without hacking it).
If you are breadboarding, simply swapping the serial lines around fixes it easy enough, but the whole TXD and RXD serial line confusion has been around for decades now, since RS232 was a thing in the first place.

That's why I like the SPI line naming, and even I2C.  Both are pretty hard to get wrong.  

But I digress......
Smoke makes things work. When the smoke gets out, it stops!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8424
Posted: 08:13am 05 Jan 2026
Copy link to clipboard 
Print this post

RS-232 has been confusing people to hell and back since it was first invented. Nothing new there. :) It starts with the D connectors. Now is it the male one or the female one that has the pins? Do I need to link these two pins to make it work? Should it be a null-modem cable? lol

I2C is so incredibly elegant but it's only intended for PCB comms, which is a pity. Works ok on the WII controllers though. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 08:44am 05 Jan 2026
Copy link to clipboard 
Print this post

I2C and SPI are master-slave protocols, so the roles are clearly defined. Therefore, the lines can be named accordingly. RS232, on the other hand, is based on bidirectional full-duplex communication, where each side can assume all roles. Therefore, the pins can only be meaningfully named from the perspective of an endpoint.

The same applies to XMODEM: It also originates from a time when files were easily exchanged between computers via serial (RS232) lines — possibly via modem, hence the name — and each side can send and receive files. Therefore, the commands are also from the perspective of the device initiating a transfer.
Edited 2026-01-05 18:45 by bfwolf
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 09:00am 05 Jan 2026
Copy link to clipboard 
Print this post

  damos said  Thanks Peter,
...
If you get bored and are looking for things to do (no pressure):

- JSON import and export of arrays of structures (unless I missed that one)
- SQLite (maybe C function). Even a basic implementation would be great, but reading tables into structure arrays would be brilliant as entity framework does it that way.
...
regards
Dan


JSON import and export can already be done with MMBasic's built-in features, I think. The files are simply sequential character streams. However, what the new version makes possible is the ability to store and use this data neatly within MMBasic's structs.

SQLite is great, but probably too complex and big to integrate into MMBasic via commands. Especially with the RP2040 and its mere 2MB of flash memory, it would consume too much memory and leave too little free space. And I doubt it's even possible to integrate it via a C function. The library binary is around 300KB in size.

What would work, though, is running an SQLite server on a second Pico, to which you send queries via a serial connection or TCP/IP. In the latter case, you'd need to use Pico-Ws.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8424
Posted: 09:06am 05 Jan 2026
Copy link to clipboard 
Print this post

If you want a database server you'd be far better putting it on a Pi rather than a Pico. It's not just the storage expansion, it's the speed of processing queries. You have space for multiple buffers etc.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 123
Posted: 09:35am 05 Jan 2026
Copy link to clipboard 
Print this post

  Mixtel90 said  If you want a database server you'd be far better putting it on a Pi rather than a Pico. It's not just the storage expansion, it's the speed of processing queries. You have space for multiple buffers etc.


You're absolutely right about performance and flexibility.
But a "full-fledged Raspberry Pi" also requires significantly more power – several watts. So, if you don't have high demands for query processing speed, SQLite on a Pico could certainly handle the tasks.

It always depends on the requirements and the environment, or rather, the application.
 
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