BASIC on the Raspberry Pi Pico & Pico 2with VGA/HDMI and PS2/USB support
This version of the PicoMite firmware for a Raspberry Pi Pico and Pico 2 includes VGA or HDMI video output and PS2 or USB keyboard input. Also included is the full featured MMBasic interpreter and support for SD card storage.
This turns the Raspberry Pi Pico or Pico 2 into a low cost self-contained desktop computer, similar to the “boot into BASIC” computers of the 1980s like the Commodore 64, Apple II and Tandy TRS-80.
You can draw graphics in many different colours, show text in multiple fonts and save your programs to an SD card.
You can have fun writing programs to balance your check book, entertain/teach children about computing and play simple computer games (to name a few activities).
The PicoMite firmware is totally free to download and use.
Firmware Versions
The PicoMite firmware comes in twelve versions that are intended to be used in three general applications depending on the periphal support included in each version (ie, touch sensitive LCD panels, VGA/HDMI output, WiFi/Internet capabibility, etc). The user manual (at the bottom of this page) goes into this in more detail but, in summary, the three typical applications for the PicoMite firmware are:
- Embedded Controller. This is where the Raspberry Pi Pico or Pico 2 is used as the brains inside some device. For example, a burglar alarm, a heating controller, weather station, etc. This is described in more detail here: https://geoffg.net/picomite.html
- Self Contained Computer. These have a VGA or HDMI video output and a PS2 or USB keyboard and boot up to display the output of the BASIC interpreter on the video monitor. They make for a simple and fun computer similar to the home computers that were popular in the 70s and 80s, for example the Apple II, Tandy TRS-80, Commodore 64 and others. This application is described in detail below.
- WiFi/Internet Connected Controller. These supports the wireless interface on the Raspberry Pi Pico W (and 2 W) and using this you can create an embedded controller which has a miniature web server running on the Pico and can access the Internet to get the time, send emails, etc. This is described in more detail here: https://geoffg.net/webmite.html
The following describes the use of the PicoMite firmware as a self contained computer.
MMBasic Interpreter
The PicoMite firmware with VGA/HDMI boots straight into the MMBasic prompt. At which point you can enter, edit and save the program, test BASIC commands and run the program.
MMBasic is a Microsoft BASIC compatible implementation of the BASIC language. It is full featured with floating point, 64-bit integers and string variables, long variable names, arrays of floats, integers or strings with multiple dimensions, extensive string handling and user defined subroutines and functions. Typically it will execute a program up to 100,000 lines per second. Embedded compiled C programs can be used for even higher performance.
Using MMBasic you can use communications protocols such as I2C or SPI to get data from a variety of sensors. You can save data to an SD card, measure voltages, detect digital inputs and drive output pins to turn on lights, relays, etc.
The emphasis with MMBasic is on the ease of use and development. The development cycle is very fast with the ability to instantly switch from edit to run. Errors are listed in plain English and when an error does occur a single keystroke will invoke the built in editor with the cursor positioned on the line that caused the error.
Documentation
The User Manual (downloadable from the bottom of this page) is a comprehensive description of the PicoMite firmware including circuits for interfacing a VGA or HDMI monitor, PS2 or USB keyboard and SD card. It details all the BASIC commands supported by MMBasic and includes a full tutorial on programming in the BASIC language including plenty of examples.
![]() |
Configured as a "Boot to BASIC" computer the PicoMite firmware is great for creating and playing simple games that were popular in the 70s and 80s such as this Tetris clone. |
VGA/HDMI Output
The VGA output is 640x480 pixels in monochrome mode or 320x240 pixels with 16 colours. The RP2350 version supports an additional mode which is 640x480 pixels in 16 colours.
The Pico 2 with the RP2350 processor supports HDMI output with an output of 640x480, 1280x720 or 1024x768 pixels in a variety of colour modes from monochrome to 32,768 colours.
In either case the video output is generated using the second CPU on the Pico's processor so it does not affect the BASIC interpreter which runs at full speed on the first CPU. A few resistors is all that is required to connect the VGA or HDMI monitor.
From within your BASIC program you can turn pixels on/off and draw lines, boxes and circles in any colour. Text can be positioned anywhere on the screen and displayed in any colour in a variety of fonts.
PS2/USB Keyboard Input
The PS2 keyboard connects directly to the Raspberry Pi Pico (via a level shifter) or Pico 2 and works as a normal keyboard with the function keys and arrow keys fully operational.
USB keyboards are connected via the USB connector on the Raspberry Pi Pico or Pico 2 using an adapter cable. The USB interface will also support a USB huh so four USB devices can be simultaneously connected and used (keyboard, mouse and game controllers).
PS2/USB Mouse Input
A PS2 mouse can be directly connected to the Raspberry Pi Pico (via a level shifter) or the Pico 2. The USB enabled versions of the firmware for the Pico or Pico 2 also accept a USB mouse.
The mouse is particually useful in the built-in editor where it can be used for cut and paste, moving the insert point, etc. The mouse position can also be queried from within a BASIC program so programs can be written that are mouse aware.
Built In Program Editor
The built-in editor within MMBasic works perfectly with the VGA/HDMI monitor and PS2/USB keyboard to allow programs to be edited (with colour coded text) and saved to program memory ready for an immediate test.
The editor is full featured with search/replace, copy/paste, etc. When an error occurs the editor will start with its cursor positioned on the line that caused the error. This makes writing and debugging programs a breeze.
Program and Data Storage
The firmware will create a pseudo disk drive in the flash memory of the Pico which acts the same as an SD Card. You can use it to store and load programs and data and access it using the normal BASIC file commands (LOAD, SAVE, OPEN, etc) including random access for database type functionality. This is done automatically and it is always available.
For removable storage SD cards can be connected with full support built into MMBasic including the ability to open files for reading, writing or random access and loading and saving programs. SD cards connect directly to the Raspberry Pi Pico and the firmware will work with cards up to 32GB formatted in FAT16 or FAT32. The files created can be read and written on personal computers running Windows, Linux or the Mac operating system.
Reference Design for VGA/PS2
The PCB illustrated on the right is a reference design for a simple boot to BASIC computer with VGA output using the Raspberry Pi Pico or Pico 2. This is an easy to assemble PCB that implements the VGA output, PS2 keyboard interface and an SD card socket.
All 40 pins on the Raspberry Pi Pico are routed to the 40-way connector on the rear of the PCB in the same configuration as that used by the Pico.
It uses easy to source thru-hole components and can be assembled in under an hour. The construction details are availabe in the download section below.
This computer was also described in the July 2022 issue of Silicon Chip magazine. This web page provides a shorter description so, if you would like the full story, you are encouraged to read the magazine article. Back issues can be purchased from Silicon Chip or electronic access can be purchased for about the cost of the printed issue.
Finding the required parts can be tedious and if you do not want to do that you can buy a complete kit of parts including the PCB
from Silicon Chip magazine for just AU$35. This includes a Raspberry Pi Pico pre programmed with the firmware, so all you need do is plug it in and you are ready to go. For the full details follow this link.
Reference Design for HDMI/USB
The PCB illustrated on the right is a reference design for a sophisticated boot to BASIC computer with HDMI output and four USB inputs for keyboard, mouse, game controllers, etc. It includes high quality audio output, a battery backed realtime clock and a micro SD card socket.
As a reference design it shows how to build a sophisticated computer using the PicoMite firmware as the base. If you are designing your own computer you can use the design of this as a reference.
This project can be built "as is" and is designed for automated assembly by JCLPCB in China. The construction details are availabe in the download section below
Hardware Support
MMBasic supports all the hardware features of the Raspberry Pi Pico (serial, I2C, SPI, CPU clock, ADC, etc) and adds support for:
- Real Time Clocks using the PCF8563, DS1307, DS3231 or DS3232 chips means that the time is always accurately known.
- Infrared Remote Control support allowing a Sony or NEC IR remote control to send signals to the BASIC program.
- Temperature and Humidity measurement using the DS18B20 or DHT22/DH11 sensors.
- Distance measurement using the HC-SR04 ultrasonic sensor.
- Numeric keypads with 4x3 keypad or a 4x4 keypad layout for numeric data entry.
- Full support for the WS2812 multi colour LED chip which can be daisy chained into long strings.
All these features are built into the BASIC interpreter, there is no need to load libraries or write special code.
Credits
Peter Mather led the project, ported the MMBasic interpreter to the Raspberry Pi Pico and wrote the hardware device drivers. Geoff Graham wrote the MMBasic interpreter and the manual. Mick Ames wrote the PIO compiler and its corresponding documentation. The VGA driver code was derived from work by Miroslav Nemecek.
Help and Support
Support questions should be raised on the Back Shed forum (http://www.thebackshed.com/forum/Microcontrollers) where there are many enthusiastic MMBasic users who would be only too happy to help. The developers of this firmware are also regulars on this forum.
Explaining Computers has an informative introduction to the PicoMite VGA version: https://youtu.be/kZaWYgIYgd8
Source Code
The compiled object code (the .uf2 file) for the PicoMite VGA is free software: you can use or redistribute it as you please. The source code is available from GitHub ( https://github.com/UKTailwind/PicoMiteAllVersions ) and can be freely used subject to some conditions (see the header on the source files).
New Version
Available below in the downloads section is a new version of the PicoMite firmware (V6.00.02). This includes support for both the Raspberry Pi Pico with the RP2040 processor and the Raspberry Pi Pico 2 with the RP2350 processor. It is a major update that includes many additional features.
User Manual (approx 230 pages including a BASIC programming tutorial) | DOWNLOAD |
PicoMite firmware V6.00.02 (includes the above manual). | DOWNLOAD |
Known bugs and issues | DOWNLOAD |
Previous versions of the firmware can be found in the archive.
Other Downloads
PicoMite VGA/PS2 Reference Design. Includes assembly instructions, parts list, schematic, PCB design files, etc. |
DOWNLOAD |
PicoMite HDMI/USB Reference Design. Includes assembly instructions, parts list, schematic, PCB design files, etc. |
DOWNLOAD |
Beta Test Version of the Firmware This is the latest test version of the next firmware release (may include bugs). |
DOWNLOAD |
MMEdit, a full featured editor for MMBasic (it runs on your PC). By Jim Hiley | WEB SITE |