matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Mon Sep 20, 2021 4:27 pm

I've posted a version of MMbasic that should support <esc>[OP etc https://www.thebackshed.com/forum/ViewT ... y=Y#175241
This is untested as I don't have access to a Linux box where I am so would appreciate knowing if it works

DarkElvenAngel
Posts: 1999
Joined: Tue Mar 20, 2018 9:53 pm

Re: MMBasic on the Raspberry Pi Pico

Mon Sep 20, 2021 6:17 pm

Would it be possible since we don't have source code yet to have a version that switches from USB UART to serial UART? I'd like to test the compatibility of this project with my serial terminal.

User avatar
scruss
Posts: 4490
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: MMBasic on the Raspberry Pi Pico

Mon Sep 20, 2021 7:38 pm

matherp wrote:
Mon Sep 20, 2021 4:27 pm
I've posted a version of MMbasic that should support <esc>[OP etc https://www.thebackshed.com/forum/ViewT ... y=Y#175241
This is untested as I don't have access to a Linux box where I am so would appreciate knowing if it works
Thanks! I will try this as soon as I get home.
matherp wrote:
Mon Sep 20, 2021 3:32 pm
MMBasic is using the X11R6 xterm codes and minicom is using the XFree86 xterm codes. These are the same except for F1-F4 and F13-F16. Is there a simple way to tell minicom to use X11R6?
I think you've got that swapped: mmbasic used the XFree86 codes that were deprecated in 1996 with XFree86 v3.2. minicom is using the VT100 and xterm-new (which got wrapped into lxterminal, Gnome terminal, etc on current distros) definitions which have been current since then.

It's confusing, I know, Even Thomas E. Dickey, the maintainer of xterm, needs a large table to keep track: xterm function keys.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

hippy
Posts: 10955
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: MMBasic on the Raspberry Pi Pico

Mon Sep 20, 2021 7:39 pm

Latest version is doing better than previous but, from the edit screen - F1 returns to > prompt and adds P, F2 returns and adds Q, F3 returns and adds R.

So seems to be exiting edit on the first ESC then whatever, not consuming the final char.

matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Mon Sep 20, 2021 9:26 pm

hippy

Thanks for testing. New version posted

Seems to be confusion as to whether it is <esc>OP or <esc>[OP for F1. I previously looked for it with the [. Now I'm looking for it without.

If that doesn't work it will have to wait for later in the week when I'm home with proper testing facilities

User avatar
scruss
Posts: 4490
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: MMBasic on the Raspberry Pi Pico

Tue Sep 21, 2021 12:23 am

matherp wrote:
Mon Sep 20, 2021 9:26 pm
Seems to be confusion as to whether it is <esc>OP or <esc>[OP for F1.
It's <esc>OP.

Unless I'm not finding the right version, 2021-09-20_190847_PicoMiteV5.05.00b20 still doesn't work in minicom: can't save in the editor

Update: the file was removed
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
led-bloon
Posts: 25
Joined: Mon Dec 03, 2012 4:48 am
Location: Oz

Re: MMBasic on the Raspberry Pi Pico

Tue Sep 21, 2021 4:56 am

In the short term, you may want to try this:
http://www.thebackshed.com/forum/ViewTo ... y=Y#175246
or this:
Mincom.7z
This requires yad to be installed, for a "nice gui" feel. Unzip to your favourite folder (<your path>) all files in the
zipped file. (I chose ~/bin). In a terminal, cd to <your path> Run minicom (the program) from the command line
and change the macros file to <your path>/.macros
exit and save setup
Now run <your path>/Mincom and swap between a default configuration or your newly created picomite config.
Add more configs if you like etc etc etc
led
Edit: corrected the link
Attachments
Mincom.7z
(648 Bytes) Downloaded 14 times

matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Tue Sep 21, 2021 6:31 am

Update: the file was removed
Reposted File with <esc>OP rather than <esc>[OP etc.

https://www.thebackshed.com/forum/ViewT ... 254#175254

Feedback appreciated

hippy
Posts: 10955
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: MMBasic on the Raspberry Pi Pico

Tue Sep 21, 2021 9:23 am

Seems to be working now for F1 through F4.

For F3 it shows, "Find (Use SHIFT-F3 to repeat):" using SHIFT-F3 there inserts [1;2R into the text. From within the edit window it returns to the prompt and adds ;2R

For F5 I am not sure what's going on as I didn't get anything received in my testing but MMBasic obviously does. F5 (paste) gives "Exit and discard all changes (Y/N):" with 6- added.

matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Tue Sep 21, 2021 10:45 am

hippy

Thanks again for testing

SHIFT F3 should now work (he hopes)

F5 is correct as it is the same in all xterm versions so it may be your system is intercepting it somehow. Use Ctrl-Y as the alternative.
And, of course, you need to tell Linux to treat backspace properly (send 0x08)

User avatar
scruss
Posts: 4490
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: MMBasic on the Raspberry Pi Pico

Wed Sep 22, 2021 12:30 am

That seems to work nicely, Peter - thank you!

Works prettily with minicom in colour mode:
Screenshot from 2021-09-21 20-22-17.png
mmbasic on a Raspberry Pi Pico
Screenshot from 2021-09-21 20-22-17.png (53.16 KiB) Viewed 1788 times
And quite fast, too. Acquits itself well on bench64, clocking in at 60× the speed of a Commodore 64:

Code: Select all

BASIC BENCH INDEX
>I GOOD. NTSC C64=100

1/8 - FOR:
 0.7S; 56052.6/S; I= 8311
2/8 - GOTO:
 3.6S; 7431.7/S; I= 1681
3/8 - GOSUB:
 1.1S; 19620.4/S; I= 5594
4/8 - IF:
 0.8S; 18024.4/S; I= 7424
5/8 - FN:
 0.7S; 5336.6/S; I= 8792
6/8 - MATHS:
 0.1S; 6490.9/S; I= 101685
7/8 - STRING:
 0.5S; 9413.1/S; I= 11449
8/8 - ARRAY:
 0.5S; 3105.9/S; I= 11126

OVERALL INDEX= 6018
though I had to redefine all the DEF FNs since mmbasic doesn't like it.

One thing: is there a way to stop the watchdog flash on GP25 on idle? I can't have flashing LEDs near me unless they're doing things I need to watch
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
led-bloon
Posts: 25
Joined: Mon Dec 03, 2012 4:48 am
Location: Oz

Re: MMBasic on the Raspberry Pi Pico

Wed Sep 22, 2021 7:02 am

SETPIN GP25,DOUT (under user control)
SETPIN GP25,HEARTBEAT
led

User avatar
scruss
Posts: 4490
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: MMBasic on the Raspberry Pi Pico

Wed Sep 22, 2021 3:18 pm

Thanks. Wouldn't it be more likely to be OPTION HEARTBEAT DISABLE, though?

I don't think this is in the manual
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Wed Sep 22, 2021 3:58 pm

The heartbeat is just a special case I/O function that happens to be pre-configured. So like other I/O you use setpin to specify the use.

To turn it off you can allocate the GP25 pin to anything else that it is capable of. The most logical way to turn it off is

SETPIN GP25,OFF

Then if you want the heartbeat back it is

SETPIN GP25, HEARTBEAT

By setting it to a digital output as led-bloon proposes you can then control the LED using PIN(GP25)=1 to turn it on and PIN(GP25)=0 to turn it off. You could, for example, also set it as a PWM output

SETPIN GP25, PWM4B

and control it

PWM 4,1000,,5

This would set a 1000Hz PWM at 5% duty cycle on the LED

NB: you will need to re-download b21 for this to work as there was previously a cut-and-paste bug affecting PWM channels 3B, 4B, and 5B
https://www.thebackshed.com/forum/ViewT ... 283#175283

I'll check if the manual which was a first draft needs updating

User avatar
scruss
Posts: 4490
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: MMBasic on the Raspberry Pi Pico

Sun Sep 26, 2021 1:40 am

but I'd like the heartbeat off to be saved as an option. I can't do that at the moment. It restarts as soon as I restart mmbasic on the Pico
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

matherp
Posts: 101
Joined: Tue May 02, 2017 10:54 am

Re: MMBasic on the Raspberry Pi Pico

Wed Oct 06, 2021 10:17 am

Full I2C slave functionality now available directly from Basic

https://www.thebackshed.com/forum/ViewT ... &TID=14185

e.g.
Master Pico

Code: Select all

SetPin gp2,gp3,i2c2
I2C2 open 100,1000
i=10
Do
  i=i+1
  a$=Str$(i)
  I2C2 write 50,0,Len(a$),a$
  Pause 200
  I2C2 read 50,0,8,a$
  Print a$
  Pause 200
loop
Slave Pico

Code: Select all

SetPin gp2,gp3,i2c2
I2C2 slave open 50,tint,rint
Do :Loop
'
Sub rint 'Slave requested to read data
  Local count
  I2C2 slave read 10,a$,count
  Print Left$(a$,count)
End Sub
'
Sub tint 'Slave requested to transmit data
  a$=Time$
  I2C2 slave write 8,a$
End Sub

User avatar
Gavinmc42
Posts: 6309
Joined: Wed Aug 28, 2013 3:31 am

Re: MMBasic on the Raspberry Pi Pico

Thu Oct 07, 2021 1:43 am

I prefer YAT on Windows.
It is closer to the original Terminal with programmable buttons on Windows before HyperTerminal messed things up.
Is there a version for Pi's? Putty is too basic for me.

Nice to see the Mite series Basic making it to Picos.
As for USB PID/VID, that's still a matter of some debate.
Best to keep it flexible/editable at the moment?
Master and Slave terminology unabashedly and it needs to stop.
Hmm, I did noticed some PCB overlay changes, thought it was due to saving a letter.
Can we still call Robots "Robots"?
Do they have a preferred pronoun yet?
https://dilbert.com/strip/2019-12-15%2000:00:00%20-0800
Sorry couldn't resist ;)

Er, what about i2c devices or USB devices?
What if they want to decide their own Addresses/PID/VID.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

lurk101
Posts: 1066
Joined: Mon Jan 27, 2020 2:35 pm
Location: Cumming, GA (US)

Re: MMBasic on the Raspberry Pi Pico

Thu Oct 07, 2021 2:45 pm

I'd hate to see this thread closed for the obvious reason. Please get the conversation back on track.

[Moderator, we don't want politics and cancel culture in this discussion, so removed that part of this thread]

ejolson
Posts: 8628
Joined: Tue Mar 18, 2014 11:47 am

Re: MMBasic on the Raspberry Pi Pico

Thu Oct 07, 2021 3:39 pm

lurk101 wrote:
Thu Oct 07, 2021 2:45 pm
I'd hate to see this thread closed for the obvious reason. Please get the conversation back on track.
I think this is a good plan. The people working on PicoMite Basic are clearly focusing on making it useful for the type of things people might do with a Pico.

Has anyone checked the bandwidth and latency obtained with the I2C setup?
matherp wrote:
Wed Oct 06, 2021 10:17 am
Master Pico

Code: Select all

SetPin gp2,gp3,i2c2
I2C2 open 100,1000
i=10
Do
  i=i+1
  a$=Str$(i)
  I2C2 write 50,0,Len(a$),a$
  Pause 200
  I2C2 read 50,0,8,a$
  Print a$
  Pause 200
loop
Slave Pico

Code: Select all

SetPin gp2,gp3,i2c2
I2C2 slave open 50,tint,rint
Do :Loop
'
Sub rint 'Slave requested to read data
  Local count
  I2C2 slave read 10,a$,count
  Print Left$(a$,count)
End Sub
'
Sub tint 'Slave requested to transmit data
  a$=Time$
  I2C2 slave write 8,a$
End Sub

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14229
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: MMBasic on the Raspberry Pi Pico

Fri Oct 08, 2021 11:59 am

Please continue with the topic on hand.

User avatar
guidol
Posts: 73
Joined: Tue Jul 03, 2012 9:21 am
Location: Mudanya, Turkey

Re: MMBasic on the Raspberry Pi Pico

Wed Oct 20, 2021 8:15 am

Pictures on how to connect a Arduino-SPI-SDCard-HAT/-Shield to the Pico for getting SDCard Support with MMBASIC
https://forum.classic-computing.de/foru ... post327340
like on Page 35 of the
PDF Manual https://geoffg.net/Downloads/PicoMite/P ... Manual.pdf

lurk101
Posts: 1066
Joined: Mon Jan 27, 2020 2:35 pm
Location: Cumming, GA (US)

Re: MMBasic on the Raspberry Pi Pico

Wed Oct 20, 2021 3:26 pm

guidol wrote:
Wed Oct 20, 2021 8:15 am
Pictures on how to connect a Arduino-SPI-SDCard-HAT/-Shield to the Pico for getting SDCard Support with MMBASIC
https://forum.classic-computing.de/foru ... post327340
like on Page 35 of the
PDF Manual https://geoffg.net/Downloads/PicoMite/P ... Manual.pdf
Wasn't source code mentioned at one point? Where is it?

DarkElvenAngel
Posts: 1999
Joined: Tue Mar 20, 2018 9:53 pm

Re: MMBasic on the Raspberry Pi Pico

Wed Oct 20, 2021 6:01 pm

matherp wrote:
Sat Sep 18, 2021 2:14 pm
The PicoMite source will be open. This is different from any of the other MMBasic versions
lurk101 wrote:Wasn't source code mentioned at one point? Where is it?
I think we still have a bit of a wait for PicoMite to come to light?

Return to “General”