Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:44 10 May 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 betas

     Page 8 of 23    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 08:51am 29 Jan 2025
Copy link to clipboard 
Print this post

V6.00.02b5 now available

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

Recodes MM.INFO(FILESIZE fname$) which may solve Javavi's issue

New

LIST PINS - does what it says

This is actually quite a sneaky implementation. There is a CSUB command CallExecuteProgram which allows a CSUB to call a Basic subroutine in the user's program. I've embedded a Basic implementation of the sub FREEPINS into the firmware completely transparently. When you call LIST PINS you are actually running a little Basic program but you don't see it and it doesn't use any user resource. AND the code is 100x simpler than doing the same thing in C

This concept could be expanded further. If you have any little Basic utilities that you think could be included then post them here.

To be considered they must be:
1: multiplatform - both RP2040 and RP2350, either all variants or covering all of VGA, HDMI, standard, or WEB.
2: Not requiring a specific setup e.g. I2C on certain pins
3: No input or output parameters
4: Generally useful

If, and when, Javavi's filemanager is completely stable then it could be considered if it meets the above criteria
Edited 2025-01-29 18:52 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 09:23am 29 Jan 2025
Copy link to clipboard 
Print this post

Nice addition (list pins).
And I see the integrated FM as a nice benefit. I hope javavi and you can work things out. I think the big nightmare is to make it work on the "standard" picomite (connected through the console). The "crunched" version is around 20kbyte.

Volhout
Edited 2025-01-29 19:29 by Volhout
PicomiteVGA PETSCII ROBOTS
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 300
Posted: 09:38am 29 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  

If, and when, Javavi's filemanager is completely stable then it could be considered if it meets the above criteria


That would be brilliant!
 
Marcel27

Regular Member

Joined: 13/08/2024
Location: Netherlands
Posts: 77
Posted: 01:49pm 29 Jan 2025
Copy link to clipboard 
Print this post

  Quote  you are actually running a little Basic program but you don't see it and it doesn't use any user resource. AND the code is 100x simpler than doing the same thing in C


Interesting.
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 436
Posted: 07:57pm 29 Jan 2025
Copy link to clipboard 
Print this post

  Volhout said  And I see the integrated FM as a nice benefit. I hope javavi and you can work things out. I think the big nightmare is to make it work on the "standard" picomite (connected through the console).

I think that it will be necessary to make a separate version of FM working in ASСII mode for the terminal.
Like mс -a  in Linux
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 220
Posted: 11:25pm 29 Jan 2025
Copy link to clipboard 
Print this post

  javavi said  I think that it will be necessary to make a separate version of FM working in ASСII mode for the terminal. Like mс -a  in Linux

That‘d be cool!
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 529
Posted: 01:23am 30 Jan 2025
Copy link to clipboard 
Print this post

Hello,

I was wondering if there is something wrong if my GP26 as an Analog Input...
(latest Version V6.00.02b5) it is constantly reading:

-0.0008058608059

But.. it's due to my overclocking (RP2350 with VGA / PS2) @ 378 Mhz

I wanted to know if this happens with all my new Pico2 .. and indeed ALL five can't do analog input readings with overclocking this high. As soon as I clock down at 315 MHz everything works fine.

This is no problem for me, it is just a warning. I rather stick to the default clockspeed  

Greetings
Daniel
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2415
Posted: 02:24am 30 Jan 2025
Copy link to clipboard 
Print this post

Perhaps it is different for each batch of chips.
> setpin gp26,ain
> ?pin(gp26)
3.3          <--- connected to Vdd
> ?pin(gp26)
0.0002686202686          <---Gnd
> ?pin(gp26)
0.5843833944          <---floating
> option list
PicoMiteVGA MMBasic RP2350A Edition V6.00.02b5
OPTION SYSTEM I2C GP14,GP15
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION CPUSPEED (KHz) 378000
OPTION DEFAULT MODE 3
OPTION DISPLAY 60, 133
OPTION SDCARD GP13, GP10, GP11, GP12
>
Same on all previous versions.

Edit. B5 very nice.
List Pins gives a detailed description of each pin. Particularly handy on a test-bed unit, no need to remember (wrongly, too often!) what goes where.
Edited 2025-01-30 13:33 by phil99
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 08:07am 30 Jan 2025
Copy link to clipboard 
Print this post

@Peter,

There is something wrong with the PIO assembler, when using side set and option.

Below code does not use the "opt" extention in side set. It operates as expected. There are 2 side set bits defines, and the 4 instructions can manipulate each of these 2 bits independently.

PIO assemble 1,".program count"
PIO assemble 1,".line 0"
PIO assemble 1,".side_set 2"
PIO assemble 1,"wait 1 pin 0 side 0"   '&b00
PIO assemble 1,"wait 1 pin 0 side 1"   '&b01
PIO assemble 1,"wait 1 pin 0 side 2"   '&b10
PIO assemble 1,"wait 1 pin 0 side 3"   '&b11
PIO assemble 1,".end program list"


If I use the option flag, the bits should assemble differently, but when running this program it errors.

PIO assemble 1,".program count"
PIO assemble 1,".line 0"
PIO assemble 1,".side_set 2 opt"
PIO assemble 1,"wait 1 pin 0 side 0"   '&b00
PIO assemble 1,"wait 1 pin 0 side 1"   '&b01
PIO assemble 1,"wait 1 pin 0 side 2"   '&b10
PIO assemble 1,"wait 1 pin 0 side 3"   '&b11
PIO assemble 1,".end program list"


[7] PIO assemble 1,"wait 1 pin 0 side 3"
Error : 3 is invalid (valid is 0 to 2)


If you comment out line 7, it assembles correctly. so it seems the error is incorrectly given.

Regard,

Volhout

P.S. this error also shows with ".side_set 3 opt" where it says 4 is fault. It feels like this check is to the index, not to the binary bit pattern.
Edited 2025-01-30 18:19 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 08:49am 30 Jan 2025
Copy link to clipboard 
Print this post

It taken you long enough to find that day 1 bug
In your test with opt set please set the number of side pins to 3 to circumvent the error and confirm for me that the binary produced is correct. Assuming OK I'll make the fix

PIO assemble 1,".program count"
PIO assemble 1,".line 0"
PIO assemble 1,".side_set 3 opt"
PIO assemble 1,"wait 1 pin 0 side 0"   '&b00
PIO assemble 1,"wait 1 pin 0 side 1"   '&b01
PIO assemble 1,"wait 1 pin 0 side 2"   '&b10
PIO assemble 1,"wait 1 pin 0 side 3"   '&b11
PIO assemble 1,".end program list"
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 08:57am 30 Jan 2025
Copy link to clipboard 
Print this post

Hi Peter,

This assembles to the code that I expect (I treat the opt bit as an extra side_set bit). The code you suggested maps the bits wrong (shifted to LSB).

So this assembles to correct binary codes

PIO assemble 1,".program count"
PIO assemble 1,".line 0"
PIO assemble 1,".side_set 3"
PIO assemble 1,"wait 1 pin 0 side &b100"
PIO assemble 1,"wait 1 pin 0 side &b101"
PIO assemble 1,"wait 1 pin 0 side &b110"
PIO assemble 1,"wait 1 pin 0 side &b111"
PIO assemble 1,".end program list"


That should be result of this, when the error does not occur.

PIO assemble 1,".program count"
PIO assemble 1,".line 0"
PIO assemble 1,".side_set 2 opt"
PIO assemble 1,"wait 1 pin 0 side &b00"
PIO assemble 1,"wait 1 pin 0 side &b01"
PIO assemble 1,"wait 1 pin 0 side &b10"
PIO assemble 1,"wait 1 pin 0 side &b11"
PIO assemble 1,".end program list"


The error is not in the assembler itself. It assembles correct, but there is an incorrect error message, stopping it from finishing.

Regards,

Volhout
Edited 2025-01-30 19:01 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 09:32am 30 Jan 2025
Copy link to clipboard 
Print this post

What version are you running? I'll post a test fix
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 10:54am 30 Jan 2025
Copy link to clipboard 
Print this post

Hi Peter,

ATM: Standard picomite 2040 (geek)

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 11:04am 30 Jan 2025
Copy link to clipboard 
Print this post

Here you go

PicoMite (2).zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 11:36am 30 Jan 2025
Copy link to clipboard 
Print this post

Yes Peter,

That fixed it.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 09:00am 31 Jan 2025
Copy link to clipboard 
Print this post

Hi Peter,

Since we are in beta, is it okay to request something that looks like a cosmetic change , but actually could go deep. ?
Is there a simple way to improve readability of the PIO assembler?

From:
PIO ASSEMBLE 1,".program toggle"
 pio assemble 1,".line 0"
 PIO ASSEMBLE 1,"set pindirs,1"
 PIO ASSEMBLE 1,".wrap target"
 PIO ASSEMBLE 1,"set pins,0"
 PIO ASSEMBLE 1,"set pins,1"
 PIO ASSEMBLE 1,".wrap"
 PIO ASSEMBLE 1,".end program list"


To something more like this:
PIO ASSEMBLE 1
 .program toggle
 .line 0
 set pindirs,1
 .wrap target
 set pins,0
 set pins,1
 .wrap
 .end program list
PIO ASSEMBLE END


So basically use the PIO ASSEMBLE as a switch, not as a command.

I hope it can be done.

Volhout
Edited 2025-01-31 19:03 by Volhout
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3998
Posted: 09:50am 31 Jan 2025
Copy link to clipboard 
Print this post

Probably not that syntax as it looks like it could break all existing PIO programs.

John
Edited 2025-01-31 19:50 by JohnS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7503
Posted: 10:13am 31 Jan 2025
Copy link to clipboard 
Print this post

I think it looks good though. Far more readable and closer to a "normal" assembler listing. Even if it only changed the list output it would be nice. Using it for program input would be *really* nice. :)
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 10:18am 31 Jan 2025
Copy link to clipboard 
Print this post

Not possible, lines are parsed individually and can't carry context. Same reason you can't have continuation lines for statements
Edited 2025-01-31 20:19 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 11:03am 31 Jan 2025
Copy link to clipboard 
Print this post

As an academic exercise I wouldn't say it was impossible, but it would certainly require some heroics. My first thought would be to do it via pre-processing from the new format into the existing format (which would resolve the backward compatibility problem at the same time). However you'd slow down initial program startup (by making two passes through the code) and if you wanted to go backwards from old -> new format when opening the EDITor then that's a bunch of extra struggle.

  matherp said  Same reason you can't have continuation lines for statements.


Definitely on the list for MMB4L ;-) But again for that  I don't have to handle the problem of translating backwards.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 8 of 23    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025