Programming MMBasic via Mac

I want to do some PicoMite development on the Mac, at the moment the process is:

Taking the SD card from the device → editing the file → saving to SD card → putting the SD card in the PicoCalc and booting → testing → rinse and repeat.

I tried using it via the Mac terminal but the “edit’“ is still limited to the 80x24 resolution.
Is there a better way to do it?

I don’t know anything about Mac.

MMEdit might be something to look at.

If you have a PicoW or Pico2W installed, and WebMite, you could use TFTP to transfer file to and from the PicoCalc. Once I started using TFTP, I no longer put the SD card in my iMac. This also avoids getting those pesky hidden files prefixed by a period.

Search for TFTP in the PicoMite manual…..Brian

Where can I download WebMite?

managed too find but how do I use it with the Mac?

You should be able to get WebMite in the same place you get PicoMite; for reference:

It’s just the build of PicoMite to support the Pico 1W and Pico 2W’s CYW43439 radio chip.

More directly, look in:

In there there will be http://raspi1.mypi.co/download/picocalc_v6.02.00a_final_pico_w.uf2 and http://raspi1.mypi.co/download/picocalc_v6.02.00a_final_pico2_w.uf2.

The PicoMite firmware for PicoW and Pico2W is called WebMite. It’s PicoMite with network capability. @tabemann has posted a link to where you can download v6.02 which is the latest build.

You can download the PicoMite/Webmite manual from here: https://geoffg.net/Downloads/picomite/PicoMite_User_Manual.pdf

I managed to download it and send files via the TFTP using this command:
printf "put <File_Name>\nquit\n" | tftp <ip>

Thank you all for the help

This is how I do it.

  • Turn on the PicoCalc and have it connect to the network, and record it’s IP address
  • Open a Mac command prompt (Terminal)
  • Enter” tftp
  • To send a file to the Pico: put <file_name>
  • To get a file from the Pico’s current directory: get <file_name>
  • When done: quit

You can also use wildcard characters to transfer multiple files at once.

….Brian

I had success running MMEdit 5 on my Mac by using Crossover, creating an empty Windows XP bottle and copying the MMEdit XP Standalone folder to it. you can download it here Geoff's Projects - MMEdit

I gave it a try but it did not work correctly, it did not display some of the elements and did not connect to the device, not via serial and not via tcp.

I guess I’ll continue with the TFTP, so far it’s the best solution (although flaky)

I did not like the TFTP so I made a shell script to load file to the device using xmodem

you will need to install “lrzsz” and “expect”

brew install lrzsz expect

then

nano pico-send
#!/usr/bin/expect -f
set port [lindex $argv 0]
set file [lindex $argv 1]
set timeout 20
spawn -open [open "$port" r+]
exec stty -f $port 115200 cs8 -cstopb -parenb -ixon -ixoff -crtscts
send "xmodem receive \"b:$file\"\r"
expect "C"
exec /opt/homebrew/opt/lrzsz/bin/sz -X -B 1024 $file < $port > $port

and last

chmod +x pico-send

to upload a file run

./pico-send <port> <file>

The way it works is by sending a string via the serial to start the xmodem xmodem receive <file>
This will put the device in listening mode and the sz -X -B 1024 $file < $port > $port will send the file in 1K blocks.

keep in mind that by default the script uploads to the B drive i.e. to the SD card.

Thank you @regevt for sharing this. TFTP works about 95% of the time as long as I have the pico in a place with a good WiFi signal.

For your solution, I assume I need to have the Pico connected to my Mac via a min-usb cable?
How do I determine the port name?
Can this script be enhanced to allow transfers from the pico to the Mac?

I’m going to try this. It’s great to have options…..Brian

You need to connect the Mac to the USB-C of the PicoCalc not to the pico itself.
According to the documentation, yes it is possible to use xmodem to pull files from the device using xmodem send <file> and my guess is that you will need to run something on the Mac that will receive it.

maybe the sz I use to send can receive but I will need to check the documentation.

I use Serial for most of my … well serial needs

regarding getting the port, you can run ls /dev/cu.* to get the ports

2 Likes

Yes, i do the same with my windows, swap the SD card, edit the program at 100 K now, swap it back into the PicoCalc.

I find that much easier on the Windows machine than dealing with the darn windows, transfer system, and raw editing of the card itself.

I updated my VSCode extension to allow remote debugging and file browsing (upload, download, delete, etc). I work on macOS so I know it works on Mac and Linux. I haven’t tested it on Windows but I don’t see any reason it wouldn’t work.