Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:35 27 Mar 2025 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.00.02 release candidates - all versions

     Page 1 of 13    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9800
Posted: 11:45am 13 Mar 2025
Copy link to clipboard 
Print this post

V6.00.02RC0 is available on

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Changes from b18

Installing this will re-initialise all flash and options etc.

New Commands and Functions

Command BIT(var%,bitno)=0 or 1  'sets a specific bit (0-63) in an integer variable
Function BIT(var%,bitno) 'returns the value of a specific bit (0-63) in a integer variable (0 or 1)
These make it very easy to use flags in a program with minimum memory usage

Command BYTE(var$,byteno)=0 to 255 ' sets a specific byte in a string to an integer value
function byte(var$,byteno) 'returns the integer value of a specific byte in a string (0-255)

these are the equivalent of the command MID$(var$,byteno,1)=CHR$(value) and
the function ASC(MID$(var$,bytebo,1)) but faster and more obvious

Functions MM.HRES, MM.VRES, MM.VER, M.I2C, MM.FONTHEIGHT, MM.FONTWIDTH, MM.PS2, MM.HPOS, MM.VPOS, MM.ONEWIRE, MM.Errno, MM.ErrMsg$, MM.WATCHDOG, MM.DEVICE$
are now all implemented as written and none of them are converted to MM.INFO calls by the pre-processor

function TEMPR(Pinno [,timeout]) 'new optional parameter timeout to override the default (200mSec) to allow for slow devices
command TEMPR START GPno [,resolution(0-3)] [,timeout]  'new optional  parameter timeout to override the default (100, 200, 400, or 800mSec) to allow for slow devices

Other changes already in b18
Bugs fixed
Various fixes to OPTION LIST
Fixes bug in forward references in PIO assembler when the starting line number is > 1
Fixes bug in PRINT @(x,y) when outputting to a computer console
By default disables heartbeat and enables access to all pins on RP2350B
Allows selection of GP19 for PSRAM PIN
Fixes bug in TILE HEIGHT 12 command in PicoMiteVGA
Fixes bug in TILE HEIGHT command in PicoMiteHDMI[USB] setting the screen to white
Fixes bug in LINSTR changing the regular expression if a variable
Fixes various bugs in PIO assembler
Fixes bug in DMA to/from PIO2 on the RP2350
Fixes memory leak in PLAY MP3 when using SPI audio
Fixes bug causing crash when trying to play all audio files in a directory if the number exceeds 20
Fixes bug in LINE PLOT
Fixes bug with ADC when system clock is above about 252MHz
Fixes onewire/tempr functionality  when using parasitic connection
Changes initialisation of HDMI pins to increase drive needed for some monitors

Changes and enhancements

the default CPU speed for the standard RP2040 PicoMite is now 200MHz. Raspberry Pi have now officially approved the RP2040 for that speed with a voltage of 1.15V which is what is set

Changing MODE to be the same now clears all framebuffers etc.

Layer buffer now available in VGA mode 1 (252MHz and above) and all HDMI mode 1 resolutions

Supports ; at the end of LONGSTRING PRINT to suppress the CR/LF

I2C(2) OPEN now supports 1000 as a speed

FILE command can now be used in a program

CHAIN fname$ [,cmdline$] ' Allows the program to run another program with the variable space preserved - command is recommended to be used in top level program and not from within a subroutine (may work OK but not tested for side-effects)

EDIT FILE command used in a program will now only be memory limited the same as EDIT

SAVE CONTEXT [CLEAR]' saves the variable space and optionally clears it - command should be used in top level program and not from within a subroutine (may work OK but not tested for side-effects). If used in a subroutine a subsequent LOAD CONTEXT must DEFINITELY be in the same subroutine or a crash/corruption will DEFINITELY happen.

LOAD CONTEXT [KEEP]' restores the variable space to the previously saved state and optionally preserves the stored variables to allow a second LOAD if required.

RAM command (RP2350 with PSRAM only) functions like the FLASH command with 5 program slots available in PSRAM. All commands except RAM LOAD (copies a RAM slot to the main flash program space) can be used in a program.
RAM FILE LOAD n,fname$ [,O[VERWRITE]] can be used to load a RAM slot from a standard disk .BAS file

SHIFT-F3 to F10 now work for computer console. NB: Shift-F1, F2, F11, and F12 don't appear to send codes so can't work

PLAY MODFILE will preferentially use space in PSRAM if enabled for the file buffer (RP2350 only). In this case a modbuffer does not need to be enabled with the OPTION command

OPTION AUDIO I2S BCLKpin, DATApin

This allows a I2S DAC to be used to provide high quality Audio. The firmware transmits the data in 32-bit mode and FLAC, MP3 (RP2350 only), and WAV data is output with no loss of information.
This command reserves BCLKpin and BCLKpin+1 for the bit clock and word clock and Datapin for the I2S data. It requires an I2S DAC that can PLL the bitclock to create its own master clock. Tested on PCM5102A and TDA1387T .

For example:
OPTION AUDIO I2S GP1,GP5
GP1 is the bit clock
GP2 is the word clock
GP5 is the data pin

All normal audio should work TONE, MP3 (RP2350 only), FLAC, WAV, MOD, SOUND

SAVE PERSISTENT n%
'saves the value n% in memory that will survive a watchdog reset (RP2040 and RP2350) or a physical reset (RP2040 only)

MM.INFO(PERSISTENT)
' recovers any value saved as above


PIO INIT MACHINE pio%,
statemachine%, clockspeed
[,pinctrl] [,execctrl] [,shiftctrl]
[,startinstruction] [,sideout [,setout] [,outout]

sideout, setout, and outout can be set to 0 (default) or 1 to specify if pins defined in pinctrl should be initialised as inputs (0) or outputs (1)

MM.INFO(BOOT)
Tells you the reason for the last restart of the Pico
Returns:

Restart            - the device has been restarted with CPU RESTART or an OPTION command
S/W Watchdog       - the device has been restarted by a software watchdog timeout
H/W Watchdog       - the device has been restarted by a hardware watchdog timeout
Firmware update    - the device has been restarted following a firmware update
Power On           - the device has been powered up
Reset Switch       - the device has been restarted using the reset switch
Unknown code &Hn   - unknown reason - please report the code and version RP2040/2350

LIST PINS - lists the current status of all pins on the processor

PIO code can now be inserted directly into Basic between a call to PIO ASSEMBLE and .end program. All PIO instructions are included as MMBasic commands including the 6 directives

Includes support for FT6336 capacitive touch chip
OPTION TOUCH FT6336 IRQpin, RESETpin [,BEEPpin] [,sensitivity]
sensitivity is a number between 0 and 255 - defaults to 50, lower is more sensitive.
SDA and SCK should be connected to valid I2C pins and set up with OPTION SYSTEM I2C
TOUCH function works as before + TOUCH(X2) and TOUCH(Y2) returns the position of a second touch location or -1 if no second location is touched.

LIST SYSTEM I2C
Produces a display showing the addresses of all I2C device connected to the SYSTEM I2C pins

New PIO functionality for RP2350A and RP2350B
Adds MOV PINDIRS,src as valid instruction
Adds support for 'prev' and 'next' for the IRQ command

New PIO functionality for RP2350B
PIO SET BASE pionum, n 'sets the base of logical PIO pins to 0 or 16 to allow pins GP30-47 to be used for PIO

Use GAMEPAD MONITOR before plugging in a gamepad and when plugged in it will show the before and after report with each change of buttons
Use GAMEPAD CONFIGURE vid,pid,i0,c0,i1,c1,i2,c2,i3,c3,i4,c4,i5,c5,i6,c6,i7,c7,i8,c8,i9,c9,i10,c10,i11,c11,i12,c12,i13,c13,i14,c14,i15,c15
to set up a gamepad that isn't supported before plugging it in.
All 34 parameters are mandatory.

New functionality from Geoff - with thanks
Now supporting  BYVAL & BYREF.  BYVAL & BYREF are prefixes that can be applied to parameters in the definition of a sub or function.  BYVAL will force the interpreter to use the value of the supplied argument even if a variable is supplied.  BYREF informs the interpreter that a variable is expected and if that is not supplied it will throw an error.

Additional parameter for OPTION LCDPANEL paralleldisplaytype (e.g. SSD1963_7[_16])
OPTION LCDPANEL display, orientation [,backlightpin] [,DCpin] [,NORESET] [,DB0pin]
The new parameter only applies to the RP2350B and allows the starting pin for the 8 or 16 data pins to be specified (defaults to GP0)
e.g. OPTION LCDPANEL SSD1963_4_16, LANDSCAPE,,,GP36,,GP2
This allows SSD and other parallel displays to be used on the new 64-pin DIL development board

Allows seek to increase file size on the A: drive

Adds support for additional gamepads

126MHz operation no longer supported for VGA versions - now defaults to 252MHz

HDMI VERSIONS
OPTION RESOLUTION 640/640,252000/720/800/848/1024/1280

RP2350 VGA VERSIONS
OPTION CPUSPEED 252000/315000/360000/378000 'NB: not available when widescreen mode enabled
OPTION WIDESCREEN 720/848/OFF

RP2040 VGA VERSIONS
OPTION CPUSPEED 252000/315000/378000 'NB: not available when widescreen mode enabled
OPTION WIDESCREEN 720/OFF

These commands between then allow
640x480 @ 75HZ - all versions
640x480 @ 60HZ - all versions
720x400 @ 60HZ - all versions (widescreen)
800x600 @ 56Hz - all RP2350 versions
848x480 @ 60Hz - all RP2350 versions (widescreen)
1024x768 @ 60HZ - HDMI versions
1280x720 @ 60Hz - HDMI versions (widescreen)

The actual CPU speeds used are:

372MHz 1280x720
315MHz 640x480 @ 75Hz
252MHz or 378MHz 640x480 @ 60Hz
324MHz 1024x768
360MHz 800x600
336MHz 848x480
283.2MHz 720x400
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4200
Posted: 01:15pm 13 Mar 2025
Copy link to clipboard 
Print this post

Bl**dy H*ll .

Reading between the lines can I conclude that:
   - You've decided not to implement a separate BYTE type ?
   - You've implemented multi-byte function tokens ? If so would you mind posting (or emailing) whether this is 2-bytes for each function token, or a hybrid approach.

Well done,

Tom
Edited 2025-03-13 23:15 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4721
Posted: 01:32pm 13 Mar 2025
Copy link to clipboard 
Print this post

Peter,

Small typo...

these are the equivalent of the command MID$(var$,byteno+1,1)=CHR$(value) and
the function ASC(MID$(var$,byteno+1,1)) but faster and more obvious


Volhout
Edited 2025-03-13 23:32 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9800
Posted: 01:34pm 13 Mar 2025
Copy link to clipboard 
Print this post

- You've decided not to implement a separate BYTE type ?


Correct

  Quote  You've implemented multi-byte function tokens ? If so would you mind posting (or emailing) whether this is 2-bytes for each function token, or a hybrid approach.


No I haven't. I've been sneaky and implemented a single hidden function to process all MM. functions. This now leave me with a few free function slots.

Have a look on github at fun_tilde in functions.c, llist in commands.c, changes to str_replace (fixes a bug where replacements could happen incorrectly) and tokenise in MMBasic.c. I'm going to add MM.CMDLINE$ and the MQTT MM.s as well in the next RC which will get rid of the various background variable creation code that current supports them.

  Quote  these are the equivalent of the command MID$(var$,byteno+1,1)=CHR$(value) and
the function ASC(MID$(var$,byteno+1,1)) but faster and more obvious


No: mid$ starts from 1 not zero like all string functions as does my new command unless there is a bug.
Edited 2025-03-13 23:38 by matherp
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 150
Posted: 01:39pm 13 Mar 2025
Copy link to clipboard 
Print this post

> option list
PicoMite MMBasic USB RP2040 Edition V6.00.02RC0
OPTION SERIAL CONSOLE COM1,GP28,GP29
OPTION SYSTEM SPI GP22,GP23,GP20
OPTION SYSTEM I2C GP24,GP25
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION KEYBOARD US, 0, 0, 200, 70
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION CPUSPEED  378000 'KHz
OPTION LCDPANEL SSD1963_7, LANDSCAPE,,GP16,NORESET
OPTION TOUCH GP21,GP19
GUI CALIBRATE 1, 130, 347, 2058, 1320
OPTION SDCARD COMBINED CS
OPTION KEYBOARD REPEAT 200,70
OPTION RTC AUTO ENABLE
>
>
> list system i2c
[LIBRARY] Dim integer _ad
Error : _ad already declared
>
>
> list pins
[LIBRARY] Dim _q%
Error : _q% already declared


GP29 is again set instead off
heartbeat and pico not shown in options
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4721
Posted: 01:46pm 13 Mar 2025
Copy link to clipboard 
Print this post

@Peter,

The new Byte(a,b) command conflicts with PEEK(Byte x), as used in petscii robots.

Volhout
Edited 2025-03-13 23:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4721
Posted: 02:00pm 13 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  
  Quote  these are the equivalent of the command MID$(var$,byteno+1,1)=CHR$(value) and
the function ASC(MID$(var$,byteno+1,1)) but faster and more obvious


No: mid$ starts from 1 not zero like all string functions as does my new command unless there is a bug.


Ok, may fault. You referred to the return value being in the range [0...255], not the variable "byteno". Byteno should be in the range [1...255] then.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9800
Posted: 02:05pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote  list system i2c
[LIBRARY] Dim integer _ad
Error : _ad already declared
>
>
> list pins
[LIBRARY] Dim _q%
Error : _q% already declared


Forgot about those  . They are coded in basic and the tokens have changed so they need re-doing

  Quote  GP29 is again set instead off
heartbeat and pico not shown in options


Option which are default don't show - what do you mean about GP29?
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 150
Posted: 02:13pm 13 Mar 2025
Copy link to clipboard 
Print this post

I think it is again set to AIN in a fresh install.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7339
Posted: 02:19pm 13 Mar 2025
Copy link to clipboard 
Print this post

But GP29 is always AIN by default unless the chip is the RP2350B. That's the only exception as the ADC ports on that start at GP40. Other modules might wire it out, but they aren't Pico modules, they are clones.
Mick

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

Joined: 20/09/2024
Location: Germany
Posts: 150
Posted: 02:25pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  But GP29 is always AIN by default unless the chip is the RP2350B. That's the only exception as the ADC ports on that start at GP40. Other modules might wire it out, but they aren't Pico modules, they are clones.


Just wanted to correct myself:
with "option pico off" gp24 and gp29 should be off. But I changed the console before issuing pico off. Sorry messed it up

But I was able to "setpin gp29,off" and change the console to gp28/29 without setting option pico to off..so gp24 was still occupied
Edited 2025-03-14 00:28 by dddns
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 150
Posted: 02:40pm 13 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  

Option which are default don't show - what do you mean about GP29?


I would find it helpful and more clear
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 188
Posted: 02:58pm 13 Mar 2025
Copy link to clipboard 
Print this post

Peter,

OPTION TOUCH FT6336 still does not generate interrupts with e.g. TOUCH INTERRUPT but reports plausible coordinates if polled.

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 150
Posted: 03:03pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote   Other modules might wire it out, but they aren't Pico modules, they are clones.

or one or the other reference design ;)
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7339
Posted: 03:12pm 13 Mar 2025
Copy link to clipboard 
Print this post

And then they aren't Pico modules. :)
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9800
Posted: 03:14pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote  OPTION TOUCH FT6336 still does not generate interrupts with e.g. TOUCH INTERRUPT but reports plausible coordinates if polled.

A demo program that fails with the FT6336 but that is known working with resistive touch would be useful. I did test this and the code hasn't changed since originally released

  Quote  The new Byte(a,b) command conflicts with PEEK(Byte x), as used in petscii robots.


Fixed - will be in RC1
Edited 2025-03-14 01:14 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4721
Posted: 03:43pm 13 Mar 2025
Copy link to clipboard 
Print this post

@Peter,

Just as some extra info:

 'uses tiles stored in library to build up playfield in layer N
Sub writeworld_n(xm,ym)
 local xsn,xpn,spn
 For xn=-xm To xm
   xsn=xs+xn*24:xpn=xp+xn+1+lva
   For yn=-ym To ym
     'load tile from world map
     spn=Peek(byte(yp+yn)*129+xpn)         '<-----------this is where it goes wrong
     Blit memory tile_index(spn),xsn,ys+yn*24
   Next
 Next
End Sub


The strange thing is that when I edit the line, to include a space between "byte" and the leading bracket, this is undone by the picomite. It changes

spn=Peek(byte (yp+yn)*129+xpn)

back to
spn=Peek(byte(yp+yn)*129+xpn)


Only when I change the code to
spn=Peek(byte 129*(yp+yn)+xpn)

it accepts the change, and the program runs.

If you can fix it, I need not fix the program...

Volhout
Edited 2025-03-14 01:44 by Volhout
PicomiteVGA PETSCII ROBOTS
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 188
Posted: 04:02pm 13 Mar 2025
Copy link to clipboard 
Print this post

@Peter:

minimalistic code for FT6336 test. Runs on RC0, RP2350,

resistive:
 OPTION RESET pico-restouch-lcd-3.5 (LCD in RLandscape mode, but doesn't matter)
 Option gui controls 70

capacitive:
PicoMite MMBasic RP2350A Edition V6.00.02RC0
 OPTION SYSTEM SPI GP2,GP3,GP4
 OPTION SYSTEM I2C GP0,GP1
 OPTION FLASH SIZE 4194304
 OPTION CPUSPEED  150000 'KHz
 OPTION LCDPANEL ILI9341, RLANDSCAPE,GP5,GP6,GP7,GP8,INVERT
 OPTION GUI CONTROLS 70
 OPTION TOUCH FT6336 GP9,GP10,,50
 GUI CALIBRATE 1, 311, 12, -10358, 11920
 OPTION SDCARD GP11

 
 gui delete all
 cls
 
 gui interrupt d_isr, u_isr
 'GUI BUTTON #1, "up|dn", 100, 100, 50, 50, rgb(white), rgb(black)
 
 do
 print touch(x), touch(y)
 pause 200
 loop
 
sub d_isr
 print "down"
end sub
 
sub u_isr
 print "up"
end sub


on touch/touch release the subs are called and valid coordinates are reported with resistive panels. With capacitive panels only coordinates are reported on touch.
                                                                 
73 de OE1HGA, Gerald
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 51
Posted: 04:04pm 13 Mar 2025
Copy link to clipboard 
Print this post

A possible solution would be avoiding same "name" for different usage..

E.g. using SetByte() for the command and GetByte() for the function?

bfwolf
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9800
Posted: 04:08pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote  The strange thing is that when I edit the line, to include a space between "byte" and the leading bracket, this is undone by the picomite.


This is nothing to do with the latest release and seems to happen with any function like this that has a bracket to start the parameter e.g DEVICE(GAMEPAD (2+1),B) does the same thing. I think it is benign and done so that a real function with a space before the bracket is parsed properly e.g. EXP (10). Please confirm on b18 and you should find the change happens but Petscii runs fine
 
     Page 1 of 13    
Print this page
© JAQ Software 2025