PicoCalc Speaks .NET: Five C# Drivers for nanoFramework

The Clockwork PicoCalc is a small pocket computer-calculator: a 320 × 320 screen, a real keyboard, an SD card slot, two speakers, and a socket for a Raspberry Pi Pico or a Pico 2 W. I wanted to run C# on it, with .NET nanoFramework. What was missing were the drivers for each part. So I wrote them, and they are now published: five NuGet packages, a public GitHub repository, and a demo to try them out.

Ordinateur de poche Clockwork affichant le menu de démonstration PicoCalcNano à l’écran.
Demo program in C#

Five packages, one per part

Each driver is a separate package, so you only install (and load into memory) what you need. They all share the same namespace, PicoCalcNano, and are published together as version 0.1.0.

NuGet packageWhat it does
PicoCalcNano.KeyboardThe keyboard: key events with code, character and modifiers
PicoCalcNano.DisplayThe 320 × 320 display: 40 × 20 text with hardware scrolling, drawing, in-memory canvas, 8 × 16 font
PicoCalcNano.ConsoleA standalone console: line editing, history, graphics mode
PicoCalcNano.SdCardThe SD card over SPI, with a FAT16 / FAT32 file system (read and write)
PicoCalcNano.SoundBeeps, notes and melodies on the two speakers

The console is built on the display and the keyboard; the other three are independent.

Install and try

In Visual Studio, open the NuGet package manager of your nanoFramework project, search for PicoCalcNano and install what you need. NuGet automatically adds the nanoFramework packages each driver depends on.

The shortest way to see something on the screen:

using PicoCalcNano;
var console = new PicoCalcConsole(); // display + keyboard
console.Start();
console.WriteLine("Hello PicoCalc");
string line = console.ReadLine("> ");
console.WriteLine("You typed: " + line);

And for sound, a melody is written as text, one note and one duration in milliseconds at a time:

var sound = new PicoCalcSound();
sound.Play("C5:300 C5:300 C5:300 D5:300 E5:600 D5:600");

To get started quickly, the repository contains a demo: a menu where the F1 to F5 keys each launch the demonstration of one package (keyboard, display, sound, console, SD card). It is also a good source of code to copy.

“Au clair de la lune” performed by PicoCalc, taken from the demonstration program.

What I learned along the way

Writing these drivers was not smooth sailing all the way, and that is what makes the result interesting.

The SD card. nanoFramework’s native file system could not mount the PicoCalc’s card on the firmware I was using. So I wrote a pure C# driver: card initialisation over SPI, then a complete FAT16 / FAT32 file system (list, read, write, delete, create folders, rename). It needs no special support from the firmware.

The sound. At first, all the notes sounded at roughly the same pitch. The cause was in the firmware: the PWM clock divider of the Pico boards was computed incorrectly. Laurent Ellerbach fixed it in nanoFramework pull request #3623, and I was able to measure the notes with a spectrum analyser: from 100 to 7,500 Hz, the frequency produced is the right one.

Bus numbering. The I2C and SPI bus identifiers of the Pico boards were not consistent between the different nanoFramework functions. Laurent Ellerbach fixed that too (pull request #3620), with the agreement of José Simões. In practice, the keyboard is on I2C bus number 1 with older firmware and number 2 with newer firmware. The keyboard driver detects the right bus automatically, so it works with both.

A big thank you to Laurent and José for their responsiveness: only a few days passed between my report and the published firmware.

Which firmware?

The drivers were tested with the PICO2_RP2350_W firmware, CLR version 1.18.0.96 (of 16 November 2026), which contains both fixes above. This version is required for sound; the keyboard, the display and the SD card also work with older versions. The drivers were also validated on a Pico (RP2040) with an earlier firmware, but I have not retested it with this version yet.

Current limits

  • The SD card is slow to write (a few KB per second); exFAT is not supported and only short (8.3) file names are created. Optimisation will come in a later version.
  • The console owns its own display and its own keyboard: do not create others in the same program, because pins can only be opened once at a time. To draw, use the console’s Display property.
  • Only one font for now (GNU Unifont, from U+0020 to U+00FF, accents included); more will follow.

What’s next?

This 0.1.0 release is a first foundation. I plan to keep improving the drivers and to add fonts, and eventually I would like to run MOGWAI NANO directly on the PicoCalc, using its keyboard and screen. If you use these drivers, your feedback, questions and ideas are welcome.

The code is licensed under Apache 2.0. The font table comes from GNU Unifont and is used under the SIL Open Font License 1.1 (details are in the repository’s NOTICE.md file).

Links

Community project, not affiliated with Clockwork.

Leave a Comment

Discover more from CODING 4 PHONE

Subscribe now to keep reading and get access to the full archive.

Continue reading