Difference between revisions of "PicoMite"

From media_wiki
Jump to: navigation, search
Line 61: Line 61:
 
   
 
   
 
  At the command prompt type '''RUN''' followed by the '''ENTER''' key or use F2 key.
 
  At the command prompt type '''RUN''' followed by the '''ENTER''' key or use F2 key.
[[File:Systeminfo.PNG |350px|right]]
+
 
 
'''Sample program'''
 
'''Sample program'''
 +
[[File:Systeminfo.PNG |270px|right]]
 
  'System-Info
 
  'System-Info
 
  Print " Rusty Cain Microrusty 2022    "
 
  Print " Rusty Cain Microrusty 2022    "

Revision as of 20:13, 8 June 2022

PicoMite

How to use a Raspberry Pi Pico Running the MMBasic Interpreter
The PicoMite firmware is totally free to download and use.
Link to PicoMite  https://geoffg.net/picomite.html
MMBasic 
Microsoft BASIC compatible implementation of the BASIC language with a built in program editor. 
Supports floating point, integer and string variables, arrays, long variable names. 

Using MMBasic with the PICO can control the I/O pins and detect digital inputs and drive output pins low or high.
Use communications protocols such as I2C or SPI to get data from a variety of sensors.

Loading the Firmware

Loading the PicoMite Firmware to the Raspberry Pi Pico board.
The Raspberry Pi Pico comes with its own built in firmware loader that is easy to use. 
Just follow these steps:
1. Download the PicoMite firmware from http://geoffg.net/picomite.html and unzip the file. 
2. Identify the firmware which should be named something like “PicoMiteV5.xx.xx.uf2”.
3. Using a USB cable plug the Raspberry Pi Pico into your computer (Windows, Linux or Mac) while
holding down the white BOOTSEL button on the Raspberry Pi Pico.
4. The Raspberry Pi Pico should connect to your computer and create a virtual drive (the same as if you had
plugged in a USB memory stick) called “RPI-RP2”. 
This drive will contain two files which you can ignore.
5. Copy the firmware file (with the extension .uf2) to this virtual drive.
6. When the copy has completed the Raspberry Pi Pico will restart and create a virtual serial port on your computer. 
The LED on the Raspberry Pi Pico will blink slowly indicating that the PicoMite firmware with MMBasic is now running

Set up Virtual Serial Port for Terminal Emulator

In Windows start Device Manager and check the "Ports (COM & LPT)" entry for a new COM port.
The terminal emulator that you use should support VT100 emulation as that is what the editor built into the PicoMite expects.   
If you are using Tera Term do not set a delay between character.
Using Putty set the backspace key to generate the backspace character.
The PicoMite ignores the baud rate setting so it can be set to any speed 
(other than 1200 baud which puts the Pico into firmware upgrade mode)
I used the following settings with Putty
Comm Port9 - Connection Serial  - Baud rate 38400 - 8 bits - No parity - Backspace Key = (CTRL H) 

Writing a basic Program

At the command prompt type EDIT followed by the ENTER key.
The editor should start up and you can enter this line: PRINT "Hello World"
Press the F1 key in your terminal emulator (or CTRL-Q which will do the same thing). This tells the
editor to save your program and exit to the command prompt.
At the command prompt type RUN followed by the ENTER key.
You should see the message: Hello World

Set date and time

Setting the date June 8 2022
Setting time 2:30 PM 
At the command prompt type the following:
time$ = "14:30:00"
date$ = "06/08/2022"
print date$ " - " time$

First Program

At the command prompt type EDIT followed by the ENTER key.
Enter the following:
'Microrusty
10 For a = 1 To 5
20 Print "Microrusty.com"
30 Next a

At the command prompt type RUN followed by the ENTER key or use F2 key.

Sample program

Systeminfo.PNG
'System-Info
Print " Rusty Cain Microrusty 2022    "
Print " "
Print "------ System Info -----------"
Print "Pico Board ID# " MM.Info(ID)        'System Board information
Print "Pico CPU Speed " MM.Info(cpuspeed)  'CPU Speed
Print "Pico Version " MM.Info(version)     'Print Version number
Print "Pico CPU Temp " Pin(temp)" C"       'CPU temp in Celsius
celsius =Pin(temp)                         'Convert Celsius to Fahrenheit 
fahrenheit = celsius * 1.8 + 32            '   "        "    "     "
Print "Pico CPU Temp " fahrenheit " F"     'CPU temp in Fahrenheit
Print " "
Print "------ System Memory ---------"
Memory                                     'Show Memory
Print "------------------------------"
Print " "
Print "      Time          Date   "
Print "  ---------------------------"
Print "  | "  Time$ "  |  " Date$" |"
Print "  ---------------------------"
Print "                           "
End



Raspberry Pi

Future Classes

Main Page