Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:08 03 May 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 2 of 6    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 11:11am 28 May 2021
Copy link to clipboard 
Print this post

  matherp said  
  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


"Both" . . . does this imply that you are planning to design a PCB with 2x20 connector? Perhaps with pads to support castellated as well as DIP soldering?

It all looks very enticing (but I do hope a keyboard can be supported for LCD console).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 11:40am 28 May 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  there is no version of the Pico with either built-in - there is only the one version.

Version with wifi and bluetooth
[QUOUTE]The u-blox NINA-W102 radio module makes this the only connected RP2040 option. It gives you full WiFi 802.11b/g/n connectivity, along with Bluetooth and BLE v4.2
There are a few with Wifi only, some with DVI via hdmi connector, some dvi adapters and much more, most with built in SPI flash memory
Irrelevant really now anyway
 
lew247

Guru

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

RP2040 with qwerty keyboard and display
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5735
Posted: 12:20pm 28 May 2021
Copy link to clipboard 
Print this post

Lew, Raspberry Pi only supply one version - the original. They are licensing the design to other manufacturers, who can customize the hardware. None of those is a Raspberry Pi Pico although they all use the RP2040. The Pico only has 2MB of flash on it, several of the other boards have increased this, allowing them to incorporate more facilities that simply won't fit on the Pico. At the moment, anyway, Peter is designing only for the Pico. That will ensure that his port will run on that board and possibly on the others - if they haven't messed up their hardware designs (tied up required IO etc.) too much.
Mick

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

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 01:51pm 28 May 2021
Copy link to clipboard 
Print this post

ooh... ooh...  "Code may be executed directly from external memory, through a dedicated SPI, DSPI or QSPI interface. A small cache improves performance for typical applications."

so that 96K thing could be upto 16MB with the right firmware
Edited 2021-05-28 23:51 by CaptainBoing
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 03:05pm 28 May 2021
Copy link to clipboard 
Print this post

  CaptainBoing said  ooh... ooh...  "Code may be executed directly from external memory, through a dedicated SPI, DSPI or QSPI interface. A small cache improves performance for typical applications."

so that 96K thing could be up to 16MB with the right firmware


RAM is fixed at 264k, with no option to expand in the RP2040 processor. external flash memory (up to 16mb) is used to execute compiled C code - the mmbasic interpreter. this is helped along by 16k (?) of cache that is invisible.

a basic program is just data as far as the mmbasic interpreter is concerned, hence copied into RAM for fast access. if an mmbasic program was retrieved a token at a time from flash, as well as the interpreter running from flash down the same SPI bus and through the same 16k cache, this would produce a performance hit. so, effectively, peter is planning to 'cache' the whole mmbasic program in RAM. 96k is quite a lot of space, especially given that it looks like you'll be able to chain one program from another.


now an interesting possibility: hook two pico's together via their USB ports - the pico is capable of acting as a USB host. pico 'A' (as a CDC device) could run mmbasic, with all the I/O pins free, while pico 'B' (as a USB host) could act as a VT100ish terminal, drive an LCD screen, and scan a matrix keyboard. this terminal emulation could be written in python, largely using existing code that is already out there.

this could give you a neat little pocket computer in a form-factor similar to this:




cheers,
rob   :-)
Edited 2021-05-29 01:09 by robert.rozee
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 03:35pm 28 May 2021
Copy link to clipboard 
Print this post

  robert.rozee said  ... this could give you a neat little pocket computer in a form-factor similar to this ...


Nice. Though you might save yourself a lot of trouble by buying a second-hand Psion Series 5 on ebay, OPL was a neat BASIC inspired language.

Best wishes,

Tom
Edited 2021-05-29 01:35 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
RetroJoe

Senior Member

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

  thwill said   ...though you might save yourself a lot of trouble by buying a second-hand Psion Series 5 on ebay...


What would be the fun in that ??  
Edited 2021-05-29 02:10 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
CaptainBoing

Guru

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

woot! less than 24 hours delivered.



just need some firmware... now what should I use? ...  
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 12:35pm 29 May 2021
Copy link to clipboard 
Print this post

  Quote  just need some firmware... now what should I use?


OK: here is the very first alpha version.

PicomiteV5.07.00a0.zip

Connect a SD card as follows (see first page for the cheapest possible SDcard "adapter"):

GP2 - CLK
GP3 - MOSI
GP4 - MISO
GP5 - CS

Connect a terminal via the USB and have a play

All normal MMBasic commands are there including full file support but no other I/O and no permanent options and/or VAR SAVE

Specific stuff

FLASH command

  Quote  
FLASH ERASE n ' erases a flash program slot n=1 to 10
FLASH BLANKCHECK n 'Checks whether a flash slot is empty
FLASH SAVE n ' Saves the current program to the flash slot specified
FLASH LOAD n ' Loads a program from the specified flash spot
FLASH RUN n ' Runs a program from the specified flash spot, clears all variables
FLASH CHAIN n ' Runs a program from the specified flash spot, leaves all variables


NB: FLASH ERASE and FLASH SAVE trigger a reset after completion
Edited 2021-05-29 22:58 by matherp
 
lizby
Guru

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

Liftoff:
Maximite Benchmark tests

Benchmark 1
0.008

Benchmark 2
0.056

Benchmark 3
0.093

Benchmark 4
0.095

Benchmark 5
0.173

Benchmark 6
0.264

Benchmark 7
0.417

Benchmark 8
0.209
> ?mm.device$
RP2040 PicoMite
>

This is quite fabulous. Didn't wire up SD yet. Did F10 (AUTOLOAD), copied benchmark.bas, F4 to look, F2 to run.
PicoMite MMBasic Version 5.07.00a0
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> memory
   0 % Program (0 lines using 0KB of 96KB)
   0 % Array, strings and general (using 0KB of 96KB)
   0 % Variables (using 0 of 512)
>

And
> list commands
?              Autosave       Case           Case Else      Cat
Chdir          Clear          Close          CLS            Color
Const          Continue       Data           Date$          Delete
Dim            Do             Dump           Edit           Else
Else If        Else If        ElseIf         End            End Function
End If         End If         End Select     End Sub        EndIf
Erase          Error          Exit           Exit Do        Exit Do
Exit For       Exit Function  Exit Sub       Files          Flash
For            Function       GoSub          GoTo           If
Input          Kill           Let            Line Input     List
Load           Local          Loop           Memory         Mkdir
Name           New            Next           On             Open
Option         Pause          Poke           Print          Randomize
Read           Rem            Restore        Return         Rmdir
Run            Save           Seek           Select Case    Sub
Time$          Timer          Trace          TROFF          TRON
Wend           While
Total of 82 commands
> list functions
*              +              -              /              <
<<             <=             <>             =              =<
=>             >              >=             >>             \
^              Abs(           ACos(          And            As
Asc(           ASin(          Atan2(         Atn(           Bin$(
Chr$(          Cint(          Cos(           Cwd$           Date$
Deg(           Dir$(          Else           Eof(           Eval(
Exp(           Fix(           For            GoSub          GoTo
Hex$(          HEX$(          Inkey$         Input$(        Instr(
Int(           INV            LCase$(        Left$(         Len(
Loc(           Lof(           Log(           Mid$(          MM.Device$
MM.Errmsg$     MM.Errno       MM.Errno       MM.FONTHEIGHT  MM.FONTWIDTH
MM.I2C         MM.Onewire     MM.Ver         Mod            Not
OCT$(          Oct$(          Or             Pi             Pos
Rad(           Right$(        Rnd            Rnd(           Sgn(
Sin(           Space$(        Sqr(           Step           Str$(
String$(       Tab(           Tan(           Then           Time$
Timer          To             UCase$(        Until          Val(
While          Xor
Total of 92 functions and operators
>


~
Edited 2021-05-29 23:23 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 02:09pm 29 May 2021
Copy link to clipboard 
Print this post

can report the following:

just sitting at the MicroPython prompt, the pico draws 18mA.
running the following one-line python program:

while 1:print('hello world  ',end='')

the pico draws 23mA.

sitting at the mmbasic command prompt, the pico draws 38mA.
running a basic program, this increases to 43mA.

speed wise:
Sieve of Eratosthenes Speed Test

1.556 seconds

48122 statements
19747 lines

30926.73522 statements per second
12690.87404 lines per second


this is approximately twice as fast as an MX470 (MM+), and about 1/4 the speed of a CMM2. meanwhile, the current consumption is similar to an E-28 at 40MHz (MX170+16F1455). all-in-all, this is pretty impressive!


cheers,
rob   :-)
Edited 2021-05-30 00:09 by robert.rozee
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 02:09pm 29 May 2021
Copy link to clipboard 
Print this post

And with SD card:
Hello, world from PicoMite
> flash save 2
PicoMite MMBasic Version 5.07.00a0
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> flash run 2
Hello, world from PicoMite
> files
A:/
     4208  ta.bas
     4698  tain.txt
0 directories, 2 files
> save "hello.bas"
> files
A:/
       36  hello.bas
     4208  ta.bas
     4698  tain.txt
0 directories, 3 files
> load "hello.bas",r
> run
Hello, world from PicoMite
> list
Print "Hello, world from PicoMite"

I used this micro sd module because I had some.

Wiring:


My Newfoundland wife says I have a tendency to be what in Newfonese is a "keener". Is this proof?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 02:23pm 29 May 2021
Copy link to clipboard 
Print this post

Oops.
> Open "tain.txt" For input As #1
> ?mm.errno
Error : Internal fault (sorry)

(I note that with LIST FUNCTIONS, MM.ERRNO is listed twice.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 02:31pm 29 May 2021
Copy link to clipboard 
Print this post

Running Paul_L's ta.bas benchmark program with "IF MM.errno" commented out, and one line in the code split because with "LOAD "ta.bas" I got "line too long", I get this:
...
Please input a description of this computer or a null string to Cancel.
.... ?picomite
picomite
Running on computer 'picomite' on 01-01-2000 at 00:28:08
Starting 1,000,000 iterations of empty loop ...
Finished 1,000,000 iterations of empty loop in 4726ms or 0.0047 ms per iteration.
Starting reading 100 line file 10,000 times ...
[91] Line Input #1, in$
Error : Line is too long
>


ta.zip

(Looks like no carriage return at the end of the last line in tain.txt.)
(And no carriage return at the end of ta.bas caused my initial "line too long" error.)

~
Edited 2021-05-30 00:56 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 02:54pm 29 May 2021
Copy link to clipboard 
Print this post

a couple of minor problems:

AUTOSAVE isn't terminated by ctrl-Z. ctrl-C seems to work, usually. subsequent use of AUTOSAVE seems to append to the program already in RAM.

after FLASH SAVE n resets the pico, the USB connection is dropped. this will drive people crazy!


it may be worth considering having flash slot '0' reserved for saving the current program held in the editor when the editor is exited with F1 or F2, and which is then loaded back into the editor whenever it is started up. this would create behaviour that is backwards-compatible with the MX170, and prevent someone exiting the editor then powering down and losing their program.


btw, i'm running without any SD card attached, and everything seems fine.


cheers,
rob   :-)
 
lizby
Guru

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

The ta.bas ran to completion once I saved it to the SD card with a carriage return at the end of the bas file, and one also at the end of the tain.txt file:
.... ?picomite
picomite
Running on computer 'picomite' on 28-05-2021 at 11:49:36
Starting 1,000,000 iterations of empty loop ...
Finished 1,000,000 iterations of empty loop in 4726ms or 0.0047 ms per iteration.
Starting reading 100 line file 10,000 times ...
Finished reading 100 line file 10,000 times in 252711ms or 0.2527 ms per iteration.
Starting writing 1,000,000 line file ...
Finished writing 1,000,000 line file in 178653ms or 0.1787 ms per iteration.
Starting parse 9 strings from 100,000 strings ...
Finished parse 9 strings from 100,000 strings in 104751ms or 0.1164 ms per iteration.
Starting extracting the value from a string 1,000,000 times ...
Finished extracting the value from a string 1,000,000 times in 50795ms or 0.0508 ms per iteration.
Finished 4,900,000 iterations on computer 'picomite' in 591655ms or 0.1207 ms per iteration.
===============================================

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 03:09pm 29 May 2021
Copy link to clipboard 
Print this post

  Quote  after FLASH SAVE n resets the pico, the USB connection is dropped. this will drive people crazy!


And will always be thus, because the firmware runs from flash. In order to write to flash interrupts have to be disabled which, of course,  kills the USB

  Quote  it may be worth considering having flash slot '0' reserved for saving the current program held in the editor when the editor is exited with F1 or F2, and which is then loaded back into the editor whenever it is started up


No for the same reason
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 03:11pm 29 May 2021
Copy link to clipboard 
Print this post

More "Just Playing":
PicoMite MMBasic Version 5.07.00a0
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> OPTION LCDPANEL ili9341, L, GP18, GP19, GP20
> option list
> cls
Display not configured
>

Dang!
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 03:59pm 29 May 2021
Copy link to clipboard 
Print this post

  Quote  Dang!


  Quote  but no other I/O and no permanent options


  Quote  after FLASH SAVE n resets the pico, the USB connection is dropped. this will drive people crazy!


PS - use W10 and Teraterm and it re-connects completely automatically and transparently
Edited 2021-05-30 01:59 by matherp
 
     Page 2 of 6    
Print this page
© JAQ Software 2024