Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:04 05 Sep 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.03.02 betas

     Page 2 of 3    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 05:43pm 28 Aug 2026
Copy link to clipboard 
Print this post

Brown out detection is enabled but it monitors DVDD so has no idea if the 3.3V rail is sagging until the dvdd voltage drops at which point the chip goes in to reset.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 01:36pm 29 Aug 2026
Copy link to clipboard 
Print this post

V6.03.01b1 is now available at https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V6.03.02b1

It adds whole-array assignment, functions that return arrays, and MM.ERRLINE, on top of the single-element array dimensions introduced in b0. As with b0, please report anything odd — especially in existing programs that have nothing to do with the new features.

The new functionality is available on all versions
Edited 2026-08-29 23:47 by matherp
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 600
Posted: 05:47pm 29 Aug 2026
Copy link to clipboard 
Print this post

  matherp said  Not sure what you are asking for. COLOUR MAP works in mode 1

I would like the MAP(N) function to also work in MODE 1
So that the following example can work the same in all modes (1,2,3)

For N=0 To 15
 Color Map(N)
 Print "COLOR",N
Next

Currently using this function in MODE 1 produces an Error: Invalid for Mode

And I don't understand why this function shouldn't work and pass its values ​​for MODE 1
Edited 2026-08-30 03:50 by javavi
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 07:29pm 29 Aug 2026
Copy link to clipboard 
Print this post

It doesn't - never has. I'll look at it but no promises
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 720
Posted: 10:21pm 29 Aug 2026
Copy link to clipboard 
Print this post

Thank you for the latest change - allowing a function to return an array.

Although not stated anywhere, a function's dimensions can be made dependent on the calling array. This is important. It eliminates the requirement for a different function for every size array used.

Example:
FUNCTION INVR(N()) AS FLOAT(BOUND(N),1),BOUND(N(),2))
 MATH M_INVERSE N(),INVR()
END FUNCTION

OPTION BASE 1
DIM A(3,3)=(4,5,6,2,8,5,7,2,1)
DIM C(BOUND(A(),1),BOUND(A(),2))

C()=INVR(A())
MATH M_PRINT C()


This will work with no change to the function even if the dimensions of a() change.
Again, thank you!
Edited 2026-08-30 08:22 by toml_12953

Footnote added 2026-08-31 21:29 by toml_12953
Of course line 1 of the snippet should be

FUNCTION INVR(N()) AS FLOAT(BOUND(N(),1),BOUND(N(),2))
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1149
Posted: 01:44am 30 Aug 2026
Copy link to clipboard 
Print this post

I have not looked at the source but the CRC12 calculation is giving a different result to earlier versions.All other MATH stuff seems OK  


test_math_crc8,crc12,crc16,crc32:                              FAIL (1/6)
   6: Assert equals failed, expected &h0000FEFB but actually &h00000EFB


Sub test_math_crc()

local a$="123456789"

assert_hex_equals(&h29b1, math (crc16 a$,len(a$),,&hffff))                             'CRC16-CCITT
assert_hex_equals(&h4b37, math (crc16 a$,len(a$),&h8005,&hffff,0,1,1),8)               'CRC16-MODBUS
assert_hex_equals(&h31c3, math (crc16 a$,len(a$)),8)                                   'CRC16-XMODEM
assert_hex_equals(&ha1, math (crc8 a$,len(a$),&h31,,,1,1))                             'CRC8-MAXIM
assert_hex_equals(&hcbf43926, math (crc32 a$,len(a$),,&hffffffff,&hffffffff,1,1),8)    'CRC32
if mm.DEVICE$="ARMmite F407" then exit SUB
 assert_hex_equals(&hfefb, math (crc12 a$,len(a$)),8)                                'CRC12
End Sub


Edited 2026-08-30 11:49 by disco4now

Footnote added 2026-08-30 13:47 by disco4now
I see the source has this comment.
crc &= 0x0FFF; // the CRC register is only 12 bits wide


Does this mean latest is probably the correct version for CRC12 ?
F4 H7FotSF4xGT
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 06:19am 30 Aug 2026
Copy link to clipboard 
Print this post

  Quote  Does this mean latest is probably the correct version for CRC12 ?

Yes, the original was wrong 16-bit answer for a 12bit CRC
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 07:19am 31 Aug 2026
Copy link to clipboard 
Print this post

@toml_12953: good catch, I've added this information to the manual which has been updated on the release.
Edited 2026-08-31 17:19 by matherp
 
fred777
Senior Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 101
Posted: 12:13pm 31 Aug 2026
Copy link to clipboard 
Print this post

Fantastic MM.ERRLINE works great!

Many thanks and cheers!
 
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6088
Posted: 08:11am 02 Sep 2026
Copy link to clipboard 
Print this post

Hi Peter,

I feel free to suggest a feature for 60302 since we are in beta anyway.
After adding another DO : LOOP to an already existing game, to flush the inkey$ buffer, improving game playability through console, I feel free to suggest:

a$=inkey$    'classic use of inkey$, returning the character at read pointer
a$=inkey$,f  'new, flush buffer (read pointer=write pointer), then return character at read pointer (the last valid character)


I know it is easy to flush the buffer from MMBasic, done it many times, but by having this feature, it makes keyboard handling much easier. And without specific code for keyboard types (PS2 / USB / console).

Volhout
Edited 2026-09-02 18:13 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 08:21am 02 Sep 2026
Copy link to clipboard 
Print this post

The idea is good but the syntax makes no sense. inkey$ is an example of the function that takes no parameters so there is no way to parse your suggestion. You could consider inkey$(f) but that would break every program using inkey$ as they would then need changing to inkey$()
The correct solution would be a new function inkeyf$ but then we run into the function count limit so that is a non-starter.
 
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6088
Posted: 08:47am 02 Sep 2026
Copy link to clipboard 
Print this post

No problem,

The MMBasic code to flush the buffer is simple enough.
And only needed for console control, since USB and PS2 can use KEYDOWN, that flushes the buffer also (keeping the last 6).

Volhout
PicomiteVGA PETSCII ROBOTS
 
terekgabor
Senior Member

Joined: 02/01/2026
Location: Hungary
Posts: 115
Posted: 09:53am 02 Sep 2026
Copy link to clipboard 
Print this post

How you can flush the buffer from MMBasic?

G@bor
 
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6088
Posted: 10:01am 02 Sep 2026
Copy link to clipboard 
Print this post

You can use this to get the last key pressed when calling.
It is not tied to a keyboard type, or console, just empties the generic input buffer and returns the last valid key..


function lastkey$()
 local k$=""
 do
   lastkey$=k$
   k$=inkey$
 loop until k$=""
end function


Volhout
Edited 2026-09-02 20:03 by Volhout
PicomiteVGA PETSCII ROBOTS
 
terekgabor
Senior Member

Joined: 02/01/2026
Location: Hungary
Posts: 115
Posted: 11:03am 02 Sep 2026
Copy link to clipboard 
Print this post

Thanks!
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 720
Posted: 11:09am 02 Sep 2026
Copy link to clipboard 
Print this post

Would it be possible to add optional parameters to function and sub calls?

On a riskier but related note, would it be possible for a function to see the size of an array on the left side of an equal sign - like this? EXTERNAL would take its array size from the left side of the equation so IDN with no parameters would adjust automatically to whatever size the left side array was.

OPTION BASE 1
FUNCTION IDN(N()AS external,optional) AS FLOAT(BOUND(N(),1),BOUND(N(),2))
 LOCAL ROW,COL
 LOCAL TEMP(BOUND(N(),1),BOUND(N(),2)
 FOR COL=BOUND(N(),0) TO BOUND(N(),1)
   FOR ROW=BOUND(N(),0) TO BOUND(N(),2)
     IF COL=ROW THEN
       TEMP(COL,ROW)=1
     ELSE
       TEMP(COL,ROW)=0
     END IF
   NEXT ROW
 NEXT COL
 IDN() = TEMP()
END FUNCTION

DIM A(3,3)
A()=IDN()
MATH M_PRINT A()

1.0000     0.0000     0.0000
0.0000     1.0000     0.0000
0.0000     0.0000     1.0000

Edited 2026-09-02 21:12 by toml_12953
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11815
Posted: 02:22pm 03 Sep 2026
Copy link to clipboard 
Print this post

V6.03.02b2 is now available on https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V6.03.02b2

This includes an update to TinyUSB v0.21 which allows faster access to USB flash drives.
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 584
Posted: 04:34pm 03 Sep 2026
Copy link to clipboard 
Print this post

Peter,

b2 seems to be about 7% slower than b1. Tested with PicoMite MMBasic RP2350B and the KnivD benchmark with "Option tracecache on 128".

Gerald
                                                                 
73 de OE1HGA, Gerald
 
JanVolk
Guru

Joined: 28/01/2023
Location: Netherlands
Posts: 407
Posted: 08:35pm 03 Sep 2026
Copy link to clipboard 
Print this post

Things go wrong with the PicoMiteVGA MMBasic USB RP2040 Edition V6.03.02b2 as soon as I plug in the USB dongle for the keyboard and mouse.
If I unplug the dongle, the VGA display returns to normal, and control is limited to the serial console.
Even erasing the 16MB flash using universal_flash_nuke.uf2 doesn't help. You have to wait about a minute for the process to complete; this is normal for 16MB flash—and also for the RP2350A0A4 with 16MB flash—due to the low baud rate.

Jan.


> option list
PicoMiteVGA MMBasic USB RP2040 Edition V6.03.00RC21
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP16,GP17
OPTION FLASH SIZE 16777216
OPTION COLOR CODE ON
OPTION MOUSE SENSITIVITY 1.0000
OPTION KEYBOARD US
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION RESOLUTION 640x480 @ 315000KHz
OPTION SDCARD GP21, GP18, GP19, GP20
OPTION VGA PINS GP11,GP22
OPTION AUDIO I2S GP13,GP15', ON PWM CHANNEL 6
OPTION RTC AUTO ENABLE
OPTION MODBUFF ENABLE
OPTION F1 help
OPTION F5 list commands
OPTION F6 list functions
OPTION F7 list pins
OPTION F8 option list
OPTION F9 fm
OPTION PLATFORM PicoMiteVGAUSB RP2040-PiZero

> option list
PicoMiteVGA MMBasic USB RP2040 Edition V6.03.02b2
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP16,GP17
OPTION FLASH SIZE 16777216
OPTION COLOR CODE ON
OPTION KEYBOARD US
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION RESOLUTION 640x480 @ 315000KHz
OPTION SDCARD GP21, GP18, GP19, GP20
OPTION VGA PINS GP11,GP22
OPTION AUDIO I2S GP13,GP15', ON PWM CHANNEL 6
OPTION MODBUFF ENABLE
OPTION F1 help
OPTION F6 list commands
OPTION F7 list functions
OPTION F8 option list
OPTION F9 fm
OPTION PLATFORM PicoMiteVGAUSB RP2040-PiZero
PicoMiteVGA MMBasic USB RP2040 Edition V6.03.02b2
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

> US USB Keyboard Connected on channel 1
>
*** FAULT PC=1008AE54 LR=10084989 SP=20041DF8 CFSR=00000000 HFSR=00000000
> US USB Keyboard Connected on channel 1
>
*** FAULT PC=1008AE54 LR=10084989 SP=20041E10 CFSR=00000000 HFSR=00000000
> US USB Keyboard Connected on channel 1
>
*** FAULT PC=1008AE54 LR=10084989 SP=20041E28 CFSR=00000000 HFSR=00000000
PicoMiteVGA MMBasic USB RP2040 Edition V6.03.02b2
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 720
Posted: 10:29pm 03 Sep 2026
Copy link to clipboard 
Print this post

  matherp said  V6.03.02b2 is now available on https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V6.03.02b2

This includes an update to TinyUSB v0.21 which allows faster access to USB flash drives.


I'm trying to compile the source for the PicoCalc and getting this:

/home/tlake/picocalc/PicoMite/PicoMite.c:78:10: fatal error: class/cdc/cdc_device.h: No such file or directory
  78 | #include "class/cdc/cdc_device.h"
     |          ^~~~~~~~~~~~~~~~~~~~~~~~


Any ideas?
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026