• Current State

    davedarko04/01/2025 at 09:25 0 comments

    Since Bookworm — the new version of Raspberry Pi OS, things have changed with setting up external displays that are connected through the GPIO pins of the 40pin header. You can connect displays in an RGB565, RGB666 or RGB888 mode and there are presets for generic displays that don't need special setups. Thankfully it's easy enough to read the documentation of the Raspberry PI boards and follow through to make the PI zero yell RGB on all pins I chose. Just be aware if you're googling that you might run into outdated tutorials!

    The HD371001C40 display that I chose from adafruit needs to be initialised through a 9-Bit SPI interface. In my first glance over existing code I thought I would be able to just copy the init code array of the adafruit examples and send that through a real SPI port of the RP2040 and be done with that.

    Sadly it is not that easy. Adafruit is using a special routine to send the codes through a shift register that's connected through I2C. In that function it also reads certain codes from the array and figures out which byte is a command and which one is a data packet. So only sending these additional packets through an 8Bit port just doesn't make sense to the display at all, as the display is expecting the first bit to be a command / data flag.

    From here I could go two routes: I can try bitbanging 9 bit SPI from the Raspberry Pi directly, like the cool kids from pimoroni are doing - or I could start learning a bit about the PIOs of the RP2040 that I have slapped on my test board and do it that way. I chose PIOs. Because that sounded more fun.

    After turning to some AIs, I finally understood why the people who are telling me how cool and helpful LLMs are for coding, are also the people who seem to be always frustrated about their code not working and not figuring out why exactly.

    Since the 9-bit SPI feels like making three LEDs blink in different speeds, I should come a long way with the tutorials I have spotted so far.

  • PCB for testing display

    davedarko03/19/2025 at 14:22 0 comments