Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:25 20 Apr 2024 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 : MMBasic on the Raspberry Pi Pico - proposed functionality

     Page 1 of 6    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 09:00am 27 May 2021
Copy link to clipboard 
Print this post

On another thread I've described running MMBasic on the Raspberry Pi Pico.

At the moment this is just the bare interpreter but it is running well and I've implemented many of the performance enhancements of the CMM2 so it is also running fast.

In this thread I will describe, for comment, my proposal for the complete MMBasic implementation on the Pico

The build is targetted at the standard Pico from Raspberry Pi. Effectively this can be considered as a 40-pin DIP chip so it has all the advantages of the 28-pin PIC32MX170 in terms of ease of use and my proposal is to implement MMBasic on the Pico as a "super" DIP MM+.

There are 29 I/O pins on the Pico which will be fully available to the MMBasic user with access to the various H/W functions supported by the chip (SPI, I2C UART, PWM, ADC)

In addition there is a USB port. This will be used for the serial console so no additional H/W is needed to connect to a PC.

Memory usage is still to be finalised but will likely be 96K maximum program size, 256 global variables + 256 local variables + 96K for arrays and strings.

For performance reasons the running program will be in RAM however, it will be possible to store up to 10 different programs in the onboard flash memory and any of these can be executed from MMBasic and set to autorun on power up. Options and saved variables will also be stored in the onboard flash. 1Mb is allocated for the MMBasic interpreter and 1MB for MMbasic programs, options, and saves variables

The Pico will support a full SDcard implementation as per the MM+

Graphics support will be for SPI connected TFT screens not parallel displays, HDMI, VGA, or DVI. All of those would require the use of too many pins and/or too much memory to meet the design spec of an embedded processor.

The build will include the full MM+ GUI functionality + many of the CMM2 functional enhancements (MATHS etc.)

The RP2040 processor will be overclocked to run at 250MHz. This is well below the speeds others have used to implement things like HDMI and seems completely robust.
Performance at this clock speed is considerably faster than a 120MHz MM+ and faster than an ArmmiteF4 coming in below the MMX, ArmmiteH7 and, of course, the CMM2.

The build will be basically single processor as MMbasic does not easily support a second processor although it may be possible to offload some processing.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 09:12am 27 May 2021
Copy link to clipboard 
Print this post

Sounds good Peter, hope the interest is there.

Will we be able to CHAIN and run the programs from flash? This would bust the 96K limit very nicely and provide overlaying to almost a megabyte.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 09:56am 27 May 2021
Copy link to clipboard 
Print this post

sounds good peter        what is the maximum number of variables available on an MX170 (micromite mk2)? i presume the 256 limit is to allow hashing?

may be useful:

- ability to use one of the serial ports as the console.
- retain the option to use GPn pin-numbering as well as the 40-pin dip pin numbers.
- allow setting the range for analog inputs (eg, OPTION VREF 3.125), as a reference can be attached to the ADC-VREF pin to set the range.
- can the two pins on the debug connector be used for anything else - such as two extra I/O pins?

note that GP23 and 24 are not brought out to the edge of the PCB, and are used internally by the USB and PSU. GP25 connects to the onboard LED only, while ADC3 is hardwired to monitor the (unregulated) system supply.

have you checked the current draw? i've been playing around with some pico's, and running micro python with a program that just loops, the current draw appears to be down in the 10mA range.


cheers,
rob   :-)
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 11:05am 27 May 2021
Copy link to clipboard 
Print this post

Hi Peter,

Do you envision any kind of support for the 8 PIO state machines ? Maybe not configurable from within MMBasic (may require an external tool to create a config file .. similar to how CFunctions are used), but usable as a function block within MMBasic.

I work on HW designs, and logic blocks besides the main CPU (similar to a small FPGA) could be handy.

Regards,

Edit: I was so excited, I immediately ordered 2 of them...
Edited 2021-05-27 21:15 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5707
Posted: 12:13pm 27 May 2021
Copy link to clipboard 
Print this post

These look fun. Great for when you need something a bit bigger than the MX170 - and not much difference in price! This might be very useful for something like RS-485 multi-drop outstations.

I've just ordered a couple too, Volhout. Why waste them on C and Python? :)
Mick

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

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 12:21pm 27 May 2021
Copy link to clipboard 
Print this post

Wow , are you never sleep? Thank you for the fantastic support!
Edited 2021-05-27 22:21 by Plasmamac
Plasma
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 12:42pm 27 May 2021
Copy link to clipboard 
Print this post

Is there any possibility later on for support for the versions with Wifi/Bluetooth already built into the board?
Seed Studio


Arduino Nano RP2040
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3010
Posted: 01:27pm 27 May 2021
Copy link to clipboard 
Print this post

This looks excellent.

For the SPI LCD, will larger screens like the 3.5 inch SPI serial LCD screen module 480*320 TFT ILI9488 be supported? With, one hopes, LCD CONSOLE, no matter how frustratingly slow in scrolling?

I've seen mention in documents of a clock (other than the CPU clock speed), but no indication of an RTC (and of course, no built-in battery backup as far as I can tell). Are there special clock features which are built-in, or should one plan for an RTC battery or module?

Maybe even, with lots of flash available, optional built-in PS/2 mouse support on a couple of pins?

How did you get to 29 i/o pins instead of 26 (I note the 2x20 pi-type connector has 28 i/o pins)?

Is the pinout still a work in progress or can we have a peek? As far as pin numbering goes, I would favor CMM2-style, with perhaps "GPnn" or the like as an option.

Hope I'm not jumping the gun too much, but this is my vision:



~
Edited 2021-05-28 00:33 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 02:41pm 27 May 2021
Copy link to clipboard 
Print this post

@ Lew247
  lew247 said  Is there any possibility later on for support for the versions with Wifi/Bluetooth already built into the board?


I think Peter already answered that one:

  matherp said  The build is targetted at the standard Pico from Raspberry Pi.


@lizby: if you add SD card, real time clock....it is far cheaper to use an F4. You also get the faster parallel LCD.

Volhout
Edited 2021-05-28 00:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3010
Posted: 03:32pm 27 May 2021
Copy link to clipboard 
Print this post

  Volhout said  @lizby: if you add SD card, real time clock....it is far cheaper to use an F4. You also get the faster parallel LCD.

Right, but form factor difference, especially since the perfboard can be squeezed down for a PCB. And I'm not sure about "far" cheaper, since the micro SD module is about $1.50US and the RTC about $3US including shipping.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 522
Posted: 07:02pm 27 May 2021
Copy link to clipboard 
Print this post

Thanks again Peter as this looks to be my step up from the MM170 for newer
projects.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 705
Posted: 07:16pm 27 May 2021
Copy link to clipboard 
Print this post

> The Pico will support a full SDcard implementation as per the MM+

But operate without the SD ?

> The build will include the full MM+ GUI functionality

I.E. There will be a terminal screen ( IDE ? ) which will show
the editor and text results, but not graphics ?
Or must Minicom or some such be needed ?

> The RP2040 processor will be overclocked to run at 250MHz.

Optional right ?

And this will all run nicely on a Raspberry Pi ( as host ) ?

How is MMBasic loaded into the Pico initially ?
my site
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 08:11pm 27 May 2021
Copy link to clipboard 
Print this post

  hitsware2 said   How is MMBasic loaded into the Pico initially ?


I hope it will be via the USB bootloader and the UF2 file format, just like MicroPython.

@matherp, your proposed spec for the PicoMite looks awesome - I've got some virgin Picos ready to test it with :)
Enjoy Every Sandwich / Joe P.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 705
Posted: 08:25pm 27 May 2021
Copy link to clipboard 
Print this post

  RetroJoe said  
I hope it will be via the USB bootloader and the UF2 file format, just like MicroPython.

Me Too  
( I think ? .... I don't know if that's compatible with a terminal ? )
Edited 2021-05-28 06:27 by hitsware2
my site
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1796
Posted: 09:30pm 27 May 2021
Copy link to clipboard 
Print this post

I was only able to order one, says there is a global shortage.
I bought from Core Electronics here in Aust. for $5.75 everywhere else they seem to be $16 - $18 hope I got the correct one.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5707
Posted: 10:10pm 27 May 2021
Copy link to clipboard 
Print this post

I suspect it will be loaded using uf2 because the boot loader for that is in ROM on the Pico.

I'm guessing that "The build will include the full MM+ GUI functionality" means exactly what it says - the same SPI touch screen & extended controls as the MM+. No parallel LCD though, so no "big" or fast displays.

I suspect that standard terminal support would probably be similar to the F4. i.e. terminal via USB.

Think of this as being a sort of souped up MM+ or a sort of cut down F4. :)
Mick

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

Guru

Joined: 03/08/2019
Location: United States
Posts: 705
Posted: 10:20pm 27 May 2021
Copy link to clipboard 
Print this post

>> I suspect that standard terminal support would probably
>> be similar to the F4. i.e. terminal via USB.

' Screen ' with RPi terminal ?
my site
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9056
Posted: 02:43am 28 May 2021
Copy link to clipboard 
Print this post

Very interesting!  
Watching this thread with interest.
Smoke makes things work. When the smoke gets out, it stops!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 07:23am 28 May 2021
Copy link to clipboard 
Print this post

  Quote  Will we be able to CHAIN and run the programs from flash? This would bust the 96K limit very nicely and provide overlaying to almost a megabyte.

Yes, with or without variables being maintained


  Quote  - ability to use one of the serial ports as the console.

No: this is incompatible with the way the Pico sets up the USB serial console
  Quote  - retain the option to use GPn pin-numbering as well as the 40-pin dip pin numbers.

yes
  Quote  - allow setting the range for analog inputs (eg, OPTION VREF 3.125), as a reference can be attached to the ADC-VREF pin to set the range.

Yes
  Quote  - can the two pins on the debug connector be used for anything else - such as two extra I/O pins?

Not as far as I am aware

  Quote  note that GP23 and 24 are not brought out to the edge of the PCB, and are used internally by the USB and PSU. GP25 connects to the onboard LED only, while ADC3 is hardwired to monitor the (unregulated) system supply.

Correct - my mistake - there are only 26 usable I/O available

  Quote  have you checked the current draw? i've been playing around with some pico's, and running micro python with a program that just loops, the current draw appears to be down in the 10mA range.

No: it is below the sensitivity of my USB power monitor

  Quote  Do you envision any kind of support for the 8 PIO state machines ? Maybe not configurable from within MMBasic (may require an external tool to create a config file .. similar to how CFunctions are used), but usable as a function block within MMBasic.

No thoughts as yet - definitely not phase 1

  Quote  Is there any possibility later on for support for
the versions with Wifi/Bluetooth already built into the board?

Not for the foreseeable - like all MM it is easy to use a ESP8266 for connectivity

  Quote  For the SPI LCD, will larger screens like the 3.5 inch SPI serial LCD screen module 480*320 TFT ILI9488 be supported? With, one hopes, LCD CONSOLE, no matter how frustratingly slow in scrolling?

Larger screens yes, console TBD, doesn't make much sense without keyboard support and this is intended for embedded use

  Quote  I've seen mention in documents of a clock (other than the CPU clock speed), but no indication of an RTC (and of course, no built-in battery backup as far as I can tell). Are there special clock features which are built-in, or should one plan for an RTC battery or module?

Will have normal MM time and date (main crystal derived), support for DS3231 possibly later

  Quote  Maybe even, with lots of flash available, optional built-in PS/2 mouse support on a couple of pins?

possibly later

  Quote  How did you get to 29 i/o pins instead of 26 (I note the 2x20 pi-type connector has 28 i/o pins)?

My error - 26 is correct

  Quote  Is the pinout still a work in progress or can we have a peek? As far as pin numbering goes, I would favor CMM2-style, with perhaps "GPnn" or the like as an option.


Will allow both

  Quote  But operate without the SD ?

Yes the SD will be optional

  Quote  I.E. There will be a terminal screen ( IDE ? ) which will show
the editor and text results, but not graphics ?
Or must Minicom or some such be needed ?


Don't understand - serial console will be over USB - same as F4 but equivalent to UART on MM2

  Quote  > The RP2040 processor will be overclocked to run at 250MHz.

Optional right ?

Two speeds allowed 125MHz and 250MHz

  Quote  And this will all run nicely on a Raspberry Pi ( as host ) ?
' Screen ' with RPi terminal ?

Anything that can connect to a USB CDC device

  Quote  How is MMBasic loaded into the Pico initially ?
I hope it will be via the USB bootloader and the UF2 file format, just like MicroPython.
I hope it will be via the USB bootloader and the UF2 file format, just like MicroPython.

Press button on Pico while powering on. Copy uf2 file to disk that appears on your computer
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5707
Posted: 07:31am 28 May 2021
Copy link to clipboard 
Print this post

Thanks Peter. That's cleared up a lot, I think. :)

Incidentally, someone asked about bluetooth. Bluetooth and wifi don't exist on the Pico. There are add-ons for those, but there is no version of the Pico with either built-in - there is only the one version.

It isn't a Raspberry Pi as such and has virtually nothing in common with the rest of the Pis. It doesn't even run linux (yet!).

A huge advantage is that we are no longer restricted by Broadcom's NDAs and there is no underlying OS. The SOC is Raspberry Pi's design (and all the documentation seems to be very good - but heavy going in places!).
Edited 2021-05-28 17:49 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 1 of 6    
Print this page
© JAQ Software 2024