Some time ago I did think about using the Raspberry Pi Pico (RP2040 CPU) with RunCPM CP/M 2.2 Emulator from Marcelo Dantas (at github named MockbaTheBorg), because its a cheap and well supported platform and its available in this times 😉 so I forked it as my (at github named guidol70) Raspberry Pi Pico Port 🙂

After some try & error I did found out that the RunCPM-Source used in the variant for the Arduino Due could be compiled on the Raspberry Pi Pico with some few modifications.

I had to create a hardware-config-file and had the source to tell that the Pico is using the ROM/BDOS in regions like the Arduino Due.

For using the Raspberry Pi Pico in the Arduino IDE I did install the arduino-pico board support from
Earle F. Philhower, III (at github named earlephilhower)

arduino-pico
RP2040 Boards Manager Support

We also do use the SDFat-Library from Bill Greiman (at github named greiman) like on the normal RunCPM-ports for Arduino Due, ESP32 and STM32 (STM32 is the only one of these which uses the SoftSPI-Mode)

The SPI-Pinout for the SDCard Reader/Writer I did choose after a Pinout – to which I decided me – while installing Picomite BASIC (from Geoff Graham) on my other Pico. I did choose these pins, because they are all on one side of the board.

While test-compiling RunCPM for the Pico I came across that the max. CPU speed for the RunCPM-Sketch is 250Mhz and the SDCard-Init max. should be 19Mhz. Sometimes or in some Reader/Writer/SDCard combinations also 25Mhz do work for the SDCard-Init, but it isnt noticeably faster.

RunCPM Bootscreen on the Raspberry Pi Pico

ATTENTION:
Please connect your SDCard Reader/Writer (if it has a 5v->3.3 StepDown-Converter) to 5V, because the 3.3V (OUT) rail at Pin 38 may be insuffcient to deliver enough 3.3V for the Pico and the SDCard Read/Writer 😦

SDCard Reader/Writer is attached to the SPI-BUS as follows:

   MISO - Pin 21 - GPIO 16
   MOSI - Pin 25 - GPIO 19
   CS   - Pin 22 - GPIO 17 - Card Enable/Select / SS
   SCK  - Pin 24 - GPIO 18 - Clock
   GND  - Pin 38           - GND
   5V   - Pin 40           - VBUS
The PinOut-schemata

The Source-Code, Binary-Pico-.UF2-flash-images and the Content for the SDCard you could find at the RunCPM-github-page for the Raspberry Pi Pico

For flashing the .UF2-Binary you need to press and hold BOOTSEL (white button) and connect your Pico to your computer (or using a/the RESET-Button when already connected) and copy the .UF2 to the Pico-Drive via the file-explorer.

For better performance the precompiled binary is compiled with the -O3 optimization to gain up to 34.78% speed above the normal compile.

German readers can also take look at the RunCPM Pico thread in the german computer Forum V.z.E.k.C

If you want to compile the Source by yourself, then keep in mind to change the following files according to the attached pictures 🙂

C:\Users\guido\Documents\Arduino\libraries\SdFat\src\SDFatConfig.h
Set SDFAT_FILE_TYPE from the standard installtion value 3 to 1
for All othe boards

set SPI_DRIVER_SELECT to hardware-SPI-mode

To avoid some warning-messages while compiling change the following files:

C:\Users\guido\Documents\Arduino\libraries\SdFat\src\SDFat.h
Comment out the warning message to
get rid of the has_include warning

C:\Users\guido\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\2.4.0\platform.txt
(to find the file replace guido with your username )
change from (gnu17 and gnu++17)
change to (gnu11 and gnu++11)

Front-View on the breadboard
Rear-View on the breadboard
Detail-View for the Front-PinOut
Detail-View for the SDCard-Reader/Writer-SPI-PinOut