Project Preview: LED Matrix Display

Posted 25 May 2023
an LED matrix display in an oak enclosure, showing multi-colored text in
        various bitmap fonts

This is still a work in progress: a full series of articles should be on the way, but I wanted to give a quick preview of a project I’ve been doing to explore the PIOs and network functionality of the RP2040/Raspberry Pi Pico W.

This series will feature a little bit of everything:

So, hopefully more content coming soon. In the meantime, here are a few more photos:

a homemade PCB, front side
Front side of unpopulated controller board
a homemade pcb, back side
Back side of unpopulated controller board
populated PCB plugged in to the back of an LED module
Populated controller board with Pico W and 74AHCT04 inverters for level shifting

And here’s a peek at the PIO code. This goes along with a fair bit of setup in the C code to configure everything and feed the framebuffer to the FIFOs using DMA, but the PIO programs themselves are nice and small.

.define PUBLIC N_DATA_PINS          6
.define PUBLIC N_ROW_PINS           4
.define PUBLIC OE_PERIOD_BITS       8

.program matrix_pixel_ctlr
.side_set 1                             ; side pin is pixel clock
                                        ; out pins are pixel data

    mov x, isr              side 0      ; copy row width into x
    out pins, N_DATA_PINS   side 0      ; write pixel data to outputs
    jmp x-- row_loop        side 1      ; loop until row is done
    irq wait 0              side 0 [4]  ; signal row controller

.program matrix_row_ctlr
.side_set 2                             ; side pins are ~OE, latch
                                        ; out pins are row select lines
    wait 1 irq 0            side 0b10   ; wait for row to finish
    out pins, N_ROW_PINS    side 0b11   ; output row index; latch pixels
    out x, OE_PERIOD_BITS   side 0b01   ; set x to OE pulse length
    jmp x-- pulse_loop      side 0b00   ; spin with OE asserted until x is zero
Previous post: Fixing up my place on the web