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
I confirmed this with Adafruit Blinka over u2if firmware. u2if claims
DOGFOOD
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:-
After every SPI setup, take
GP16back as an output. -
Then set
DCback to the level the driver last chose. - After start-up, send
MADCTL 0x00to 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 osos.environ["BLINKA_U2IF"] = "1"import board, busio, digitaliofrom 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.configuredef configure(**kwargs): _configure(**kwargs) dc.reclaim() # u2if claims GP16 as MISO on every SPI setupspi.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 screendisplay.fill(0x001F) # bluedisplay.fill_rectangle(0, 0, 30, 30, 0x07E0) # green, top-left
Revision History
- 2026 12 - Created