![]() |
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 KingdomPosts: 9992 |
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 KingdomPosts: 2137 |
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 ZealandPosts: 2396 |
sounds good peter ![]() 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: NetherlandsPosts: 4811 |
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 KingdomPosts: 7458 |
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: GermanyPosts: 570 |
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 KingdomPosts: 1702 |
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 StatesPosts: 3298 |
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: NetherlandsPosts: 4811 |
@ Lew247 I think Peter already answered that one: @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 StatesPosts: 3298 |
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 StatesPosts: 585 |
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 StatesPosts: 715 |
> 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: CanadaPosts: 290 |
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 StatesPosts: 715 |
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: AustraliaPosts: 1958 |
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 KingdomPosts: 7458 |
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 StatesPosts: 715 |
>> 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 ZealandPosts: 9452 |
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 KingdomPosts: 9992 |
Yes, with or without variables being maintained No: this is incompatible with the way the Pico sets up the USB serial console yes Yes Not as far as I am aware Correct - my mistake - there are only 26 usable I/O available No: it is below the sensitivity of my USB power monitor No thoughts as yet - definitely not phase 1 Not for the foreseeable - like all MM it is easy to use a ESP8266 for connectivity Larger screens yes, console TBD, doesn't make much sense without keyboard support and this is intended for embedded use Will have normal MM time and date (main crystal derived), support for DS3231 possibly later possibly later My error - 26 is correct Will allow both Yes the SD will be optional Don't understand - serial console will be over USB - same as F4 but equivalent to UART on MM2 Two speeds allowed 125MHz and 250MHz Anything that can connect to a USB CDC device 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 KingdomPosts: 7458 |
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 ![]() ![]() |
![]() |