Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : PicoMite V6.02.01 betas

   Page 7 of 8    
Posted: 02:01pm
28 Feb 2026
Copy link to clipboard
matherp
Guru

V6.02.01b

PicoMiteV6.02.01b7.zip

All versions
Various internal tidying and coding improvements
New command ONESHOT

  Quote  ONESHOT triggerPin, sense, outputPin, prePulseDelay, pulseWidth
or
ONESHOT DISABLE

Will configure a background one-shot pulse generator.

When the selected trigger edge is detected on 'triggerPin', MMBasic starts a delay of 'prePulseDelay' microseconds, then toggles 'outputPin'.  After 'pulseWidth' microseconds it toggles 'outputPin' again.  This creates a pulse in the opposite sense to the output pin's idle state.

'sense' selects the trigger edge and can be POSITIVE (also POS or RISING) or NEGATIVE (also NEG or FALLING).

Timing is interrupt driven and non-blocking.  Delay and pulse width are specified in microseconds.

Notes:

'outputPin' must be OFF or DOUT when ONESHOT is configured.

If 'outputPin' is OFF it will be configured as DOUT and driven low before ONESHOT is armed.

If 'outputPin' is already DOUT, its current state (high or low) is preserved and the generated pulse is the opposite polarity.

Only one ONESHOT configuration can be active at any one time.

Additional triggers received while ONESHOT is in the pre-pulse delay period or while the pulse is active are ignored.

ONESHOT DISABLE stops background operation, cancels pending timing events and restores the output pin to its idle state if a pulse was in progress.

ClearExternalIO() also disables and clears ONESHOT background activity.

The trigger and output pins must be different pins.

Example:

SETPIN GP2, DIN
SETPIN GP3, DOUT
ONESHOT GP2, POSITIVE, GP3, 50, 200

This waits for a rising edge on GP2, delays 50µs, toggles GP3, then toggles GP3 again 200µs later.
 
Posted: 02:21pm
01 Mar 2026
Copy link to clipboard
lizby
Guru

A question: has the use of LOCAL within executable code in SUBs and FUNCTIONs been quietly made acceptable in some cases? Peter had noted that he had not been able to teach his AI not to put LOCAL in places where MMBasic would throw a syntax error, and I have found the same with Gemini--that is its most frequently repeated syntax error.

But I'm finding now that while Gemini keeps inserting LOCALs within code, it's usually not objected to unless there is some other issue with the syntax.

This has certainly reduced my frustration with Gemini. So has a change been made?
 
Posted: 03:15pm
01 Mar 2026
Copy link to clipboard
matherp
Guru

LOCAL can appear anywhere within a subroutine - this has always been the case. The error the AIs make is to put it inside a looping structure which will cause an error when it is executed the second time.
 
Posted: 03:31pm
01 Mar 2026
Copy link to clipboard
thwill
Guru


The AI "thinks" LOCAL has block-scope like local variables do in most (?) languages, but in MMBasic LOCAL has function/subroutine scope.

Tom
 
Posted: 03:52pm
01 Mar 2026
Copy link to clipboard
lizby
Guru

  matherp said  LOCAL can appear anywhere within a subroutine - this has always been the case. The error the AIs make is to put it inside a looping structure which will cause an error when it is executed the second time.


Ah, ok, thanks.

Tom--yes, the errors I had been seeing were when it was in DO or FOR loops. I had not yet noticed that it was accepted when not within re-executed code in a SUB or FUNCTION.
 
Posted: 04:03pm
01 Mar 2026
Copy link to clipboard
lizby
Guru

Here is my sad result trying to use the framebuffer with Peter's Pico2 HDMI board with firmware: HDMIUSB: Mode 3.
  Quote  
> option list
PicoMiteHDMI MMBasic USB RP2350A Edition V6.02.01b3
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 4194304
OPTION LIBRARY_FLASH_SIZE  2D000
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION RESOLUTION 640x480 @ 315000KHz
OPTION SDCARD GP22, GP26, GP27, GP28
OPTION AUDIO GP10,GP11', ON PWM CHANNEL 5
OPTION MODBUFF ENABLE  192
OPTION PLATFORM HDMIUSB
. . .
Initializing Database Engine... A:/rr/rr1d3.bas
Program:
 58K (32%) Program (1735 lines)
122K (68%) Free

Library:
 49K (27%) Library
131K (73%) Free

Saved Variables:
 16K (100%) Free

RAM:
 70K (31%) 177 Variables
 26K (11%) General
130K (58%) Free
Switching to database: layout
Database 'layout' Loaded.
2 Tables, 22 Fields.
DB:layout> RUN
[229] FRAMEBUFFER CREATE
Error : Not enough Heap memory
>

Will PSRAM help with this? Anything else I can do to gain the needed memory? All string arrays have LENGTHs, and I think I've trimmed as much else as is feasible.

EDIT: Just tried with Mode 2, and that works (but will take some resizing of things).

~
Edited 2026-03-02 02:47 by lizby
 
Posted: 06:05pm
01 Mar 2026
Copy link to clipboard
dddns
Guru

  lizby said  
Will PSRAM help with this? Anything else I can do to gain the needed memory? All string arrays have LENGTHs, and I think I've trimmed as much else as is feasible.
Yes, framebuffer works in all resolutions. Also good for variables, blit slots, ram slots etc, no need for option modbuff
Just what comes to my mind right now, I'm sure that there are some more benefits
 
Posted: 06:18pm
01 Mar 2026
Copy link to clipboard
ville56
Guru

strange behavior when using

WEB CONNECT "ssid", "password"

in a program on a Pico-W-2, I get the error
Error : Invalid in a program

WEB CONNECT without parameters does not throw an error, even if no OPTION WIFI was specified before. <but it seems to do nothing...

has this always been so? At least the manual does not state that this is only allowed on the commandline. Is there no way to specify the network I want to connet to in a program?
 
Posted: 06:49pm
01 Mar 2026
Copy link to clipboard
Bleep
Guru

  lizby said  Here is my sad result trying to use the framebuffer with Peter's Pico2 HDMI board with firmware: HDMIUSB: Mode 3.
  Quote  
Switching to database: layout
Database 'layout' Loaded.
2 Tables, 22 Fields.
DB:layout> RUN
[229] FRAMEBUFFER CREATE
Error : Not enough Heap memory
>

Will PSRAM help with this? Anything else I can do to gain the needed memory? All string arrays have LENGTHs, and I think I've trimmed as much else as is feasible.

EDIT: Just tried with Mode 2, and that works (but will take some resizing of things).

~


Hi Lizby,
Why are you defining a Framebuffer?  they take a large chunk of memory and are only really used when you are doing stuff fast on the screen, like fast moving graphics or games.
 
Posted: 06:52pm
01 Mar 2026
Copy link to clipboard
bfwolf
Senior Member

  matherp said  
And forgot to mention above that b6 is now case insensitive on both the A: and B: drives


How did you ultimately achieve that?

In MMBasic itself (specifically in the FileSystem adapter layer) or did you patch LittleFs in a few places?

Regards
 
Posted: 06:55pm
01 Mar 2026
Copy link to clipboard
dddns
Guru

  ville56 said  
has this always been so? At least the manual does not state that this is only allowed on the commandline. Is there no way to specify the network I want to connet to in a program?


AFAIK yes, use WEB CONNECT to define it once and then a restart of the cpu is required. Once defined, it will reconnect to the network after a reboot or power cycle. As for a change of the parameters a reboot is required, it only works from console.
 
Posted: 07:53pm
01 Mar 2026
Copy link to clipboard
lizby
Guru

  Bleep said  Why are you defining a Framebuffer?  they take a large chunk of memory and are only really used when you are doing stuff fast on the screen, like fast moving graphics or games.


Vibe Virtual Model Railroading (TM ;-} ). So, yes, there is a lot happening on the screen. It works at HDMI 640x480 mode 3 without framebuffers, but you can see some of the workings of the screen writing. With mode 2 320x240 it's clunkier in appearance, but smoother in action. I'd like to run it at 640x480 with a framebuffer, and am hoping that will be possible with PSRAM.
 
Posted: 08:00pm
01 Mar 2026
Copy link to clipboard
dddns
Guru

@lizby Resolution 1024 or 1280 in Mode 3 look very nice and could work with framebuffer without PSRAM..maybe have a look ;)
 
Posted: 09:17pm
01 Mar 2026
Copy link to clipboard
lizby
Guru

  dddns said  @lizby Resolution 1024 or 1280 in Mode 3 look very nice and could work with framebuffer without PSRAM..maybe have a look ;)


How would I be able to have a framebuffer at 1024 or 1280 when there's not enough memory for one at 640x480 with 4-bit color? This is a 1700+ line program with a 2700+ line library and lots of fairly big arrays.
  Quote  58K (32%) Program (1735 lines)
122K (68%) Free

Library:
49K (27%) Library
131K (73%) Free

Saved Variables:
16K (100%) Free

RAM:
70K (31%) 177 Variables
26K (11%) General
130K (58%) Free

. . .
[229] FRAMEBUFFER CREATE
Error : Not enough Heap memory

Edited 2026-03-02 07:18 by lizby
 
Posted: 09:38pm
01 Mar 2026
Copy link to clipboard
dddns
Guru

  lizby said  

How would I be able to have a framebuffer at 1024 or 1280 when there's not enough memory for one at 640x480 with 4-bit color? This is a 1700+ line program with a 2700+ line library and lots of fairly big arrays.


Because of the lower resolution:

OPTION RESOLUTION 1024x768
MODE 1
1024x768x2-colours with RGB332tiles, optional layer buffer
MODE 2
256x192x16colours and colour mapping to RGB332 palette, optional layer buffer
MODE 3
512x384x16 colours and colour mapping to RGB332 palette, optional layer buffer
MODE 5
256x192x256 colours, optional layer buffer

OPTION RESOLUTION 1280x720
MODE 1
1280x720x2-colours with RGB332, optional layer buffer
MODE 2
320x180x16colours and colour mapping to RGB332 palette, optional layer buffer
MODE 3
640x360x16 colours and colour mapping to RGB332 palette, optional layer buffer
MODE 5
320x180x256 colours, optional layer buffer

Man page 73
 
Posted: 11:13pm
01 Mar 2026
Copy link to clipboard
toml_12953
Guru

Some of the changes I’d like to see in a future version:

OPTION PRINTZONES ON|OFF
Allows print zones in PRINT statements. Default: OFF

and

OPTION ZONEWIDTH n
Sets the width of print zones to n columns. Default: 10


What this will do is to allow the comma in a PRINT statement to act like other BASICs and move the cursor to the next print zone rather than just print a single space. I know it’s not as useful for a 40-column display but still it would make converting old BASIC programs a lot easier. The default is OFF for compatibility with other PicoMite BASIC programs. If you don’t want to use it, then do nothing and your programs will work as they always have.
 
Posted: 01:56am
02 Mar 2026
Copy link to clipboard
Geoffg
Guru


  toml_12953 said  What this will do is to allow the comma in a PRINT statement to act like other BASICs and move the cursor to the next print zone rather than just print a single space.

Something is not right here... the comma should advance the output to the next tab stop (default 8 char).

Geoff
 
Posted: 01:59am
02 Mar 2026
Copy link to clipboard
lizby
Guru

  dddns said  Because of the lower resolution:


Thanks, but:

I tried OPTION RESOLUTION 1024x768 Mode 3 512x384x16 : Not enough Heap memory.

And OPTION RESOLUTION 800x600 Mode 2 400x300: Not enough Heap memory.

So for now, I'm back to 640x480 Mode 2
 
Posted: 02:24am
02 Mar 2026
Copy link to clipboard
TassyJim
Guru


comma = tab works for me
> print"fred",,"barney"
fred           barney
> OPTION LIST
WebMite MMBasic RP2350A Edition V6.02.00RC5


same as always

Jim
 
Posted: 03:54am
02 Mar 2026
Copy link to clipboard
toml_12953
Guru

  Geoffg said  
  toml_12953 said  What this will do is to allow the comma in a PRINT statement to act like other BASICs and move the cursor to the next print zone rather than just print a single space.

Something is not right here... the comma should advance the output to the next tab stop (default 8 char).

Geoff


You're right about the comma outputting tabs. My bad. The default is 2. I'd like to decouple it from the tab key, though so I could have print zones wider than 8 characters. Maybe allowing a larger range for the tab key would be OK.
 
   Page 7 of 8    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026