Pimoroni Pico Explorer Base: the GP16 “MISO” pin is really the LCD’s DC

The silkscreen labels on the back and front connector silkscreen label GP16 as MISO. The ST7789 never sends data back, so Pimoroni reassigned the pin on the Explorer Base connecting GP16 to the onboard LCD's DC pin. The display uses DC to tell commands from pixel data. 

Pimoroni’s own code agrees. See common/pimoroni_bus.cpp in the pimoroni-pico repo. Pimoroni’s MicroPython firmware is built on this C++ code. For the Pico Explorer Base’s LCD, get_spi_pins() returns:
 cs=17  sck=18  mosi=19  miso=PIN_UNUSED   dc=16 

MISO is unused, and GP16 is assigned to DC. The breakout SPI slots also use GP16 as DC. So the “MISO” silkscreen label on GP16 is wrong.

Why we care

Some SPI setups claim GP16 as MISO. GP16 then becomes an input. The display can no longer tell commands from pixel data. The screen stays blank, with the backlight on.

I confirmed this with Adafruit Blinka over u2if firmware. u2if claims GP16 as MISO on every SPI setup. Adafruit’s adafruit_rgb_display sets up SPI before every write. Out of the box, the panel stayed blank.

Getting adafruit_rgb_display working

Three changes made it work on my board:
  1. After every SPI setup, take GP16 back as an output.
  2. Then set DC back to the level the driver last chose.
  3. After start-up, send MADCTL 0x00 to the display.
One catch on u2if: switch_to_output(value=True) leaves the pin low. Set the level with value afterwards.

MADCTL

MADCTL 0x00 is Pimoroni’s own setting. With it, drawing is upright and full screen. MADCTL sets which way the display fills its memory. The library always sets MADCTL to 0xC0, a 180° rotation. The ST7789 has 320 rows of memory. This panel only shows 240 of them. At 180°, drawing lands 80 rows off the screen. It also comes out upside down. y_offset=80 fixes the position, but not the flip. The library’s rotation code only rotates images, not shapes. 

The Code

This code draws a blue screen with a green square in the top left corner:

import os
os.environ["BLINKA_U2IF"] = "1"
import board, busio, digitalio
from adafruit_rgb_display import st7789
class Gp16Dc:
"""GP16 as DC, taken back after each u2if SPI setup."""
def __init__(self):
self.pin = digitalio.DigitalInOut(board.GP16)
self.level = False
def switch_to_output(self, value=False, **kwargs):
self.pin.switch_to_output(**kwargs)
self.value = value
@property
def value(self):
return self.level
@value.setter
def value(self, v):
self.level = v
self.pin.value = v
def reclaim(self):
self.pin.switch_to_output()
self.pin.value = self.level # switch_to_output(value=True) ends low
spi = busio.SPI(board.GP18, MOSI=board.GP19)
dc = Gp16Dc()
_configure = spi.configure
def configure(**kwargs):
_configure(**kwargs)
dc.reclaim() # u2if claims GP16 as MISO on every SPI setup
spi.configure = configure
cs = digitalio.DigitalInOut(board.GP17)
display = st7789.ST7789(spi, cs=cs, dc=dc, width=240, height=240,
baudrate=24_000_000)
display.write(0x36, b"\x00") # MADCTL: upright and full screen
display.fill(0x001F) # blue
display.fill_rectangle(0, 0, 30, 30, 0x07E0) # green, top-left

DOGFOOD

Revision History
  • 2026 12 - Created

Popular posts from this blog

Badgeware: Digital Dice for the Pimoroni Badger and Tufty 2350

GitHub "Clone to Desktop" with Windows GitHub.

Claude Hardware Buddy on the M5Stack Core2 - AWS IOT Edition