~alderwick/pico-uxn-sharpdisplay

Uxn on Raspberry Pi Pico and SHARP Memory Display
Elaborate on framerate.
Add a couple of pictures.
Add building instructions to README.

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~alderwick/pico-uxn-sharpdisplay
read/write
git@git.sr.ht:~alderwick/pico-uxn-sharpdisplay

You can also use your local clone with git send-email.

#Uxn on Pico with SHARP Memory Display

#Hardware

hardware overview

The SHARP Memory Display is connected as follows:

  • SCLK to GP7
  • MOSI to GP8
  • CS to GP9

These pins can be changed by editing config.h.

screen close-up

(The protective film is still on the screen, so that's why there's a yellow stripe there.)

#Uxn devices defined

This is a super basic example, with just the Screen device defined. In future, the Controller device will be incorporated using a virtual serial port on the Pico's USB device.

#To build

make

The Makefile downloads the Raspberry Pi Pico SDK, TinyUSB and Uxn into the pico-sdk, pico-sdk/lib/tinyusb and uxn directories respectively.

If you have picotool installed, you can flash the Pico with:

make flash

#About the Screen device

The SHARP Memory Display is only black and white, while Uxn provides four colors. The current color mapping is:

Layer Color number Result
fg 0 (transparent)
fg 1 White
fg 2 Black
fg 3 Blinking, mainly white
bg 0 Black
bg 1 White
bg 2 Blinking, mainly white
bg 3 Blinking, mainly black

It's a bit of a bizarre mapping, compared to Uxn's original scheme, and of course flashing can be achieved in the ROM that Uxn runs, but it's an easy way to provide simple UIs where, e.g., the selected tool in a toolbox blinks.

The color mapping is done entirely in the PIO program, so the Screen's memory can be transferred with DMA out to the SHARP display with hardly any work done by the ARM core.

Writing the whole screen takes around 50 ms or three standard Uxn frames, limited by the communication rate of the display hardware. Individual rows of the display can be written independently, so to improve the framerate only dirty rows are written when screen_redraw is called. Uxn's Screen vector is still called at 60 Hz so time-sensitive things run at the correct speed even if writing to the display falls behind.

#Todo

  • Fully implement blinking
  • Add Controller device over USB, perhaps Console too