Skip to content

examples: add 2.13in e-Paper V1 demo for RP2040-PiZero - #1

Closed
davecheney wants to merge 1 commit into
devfrom
davecheney-epd2in13-pizero-demo
Closed

examples: add 2.13in e-Paper V1 demo for RP2040-PiZero#1
davecheney wants to merge 1 commit into
devfrom
davecheney-epd2in13-pizero-demo

Conversation

@davecheney

Copy link
Copy Markdown
Owner

Adds a hardware bring-up demo for the Waveshare 2.13in e-Paper HAT V1 driven by a Waveshare RP2040-PiZero.

Why

There was no example that pairs the waveshare-epd/epd2in13 driver with a board that has a Raspberry Pi 40 pin header. Working out the pin mapping is the hard part, because Waveshare exchanges GPIO10 and GPIO11 on the RP2040-PiZero header so that RP2040 SPI1 SCK and TX align with the Raspberry Pi SCLK and MOSI positions. That swap is only visible in the schematic, and without it you would reasonably conclude that hardware SPI cannot reach the HAT and reach for a bit-bang implementation. The pin table in the file records the mapping and cites the schematic, so the next person does not have to derive it.

What it does

The demo clears the panel, then draws a test pattern chosen so that a partial result localises the fault rather than just reporting failure:

  • a 2 pixel border, which proves the full addressable area
  • two diagonals, which show any row or column stride error
  • a solid black block, which shows the darkest level the panel reaches
  • an eight step dither ramp, which exercises the LUT

It logs progress over USB serial and then enters deep sleep, since an e-paper panel holds its image without power.

Scope

The header comment is explicit about what this is verified against, because the driver is not interchangeable across panel revisions. epd2in13 sends the IL3820 init sequence and a 30 byte LUT. V2 and later use the SSD1680, which needs a different init sequence and a 153 byte LUT, so this demo will not drive them. The comment lists the panel revisions and boards as known working, untested, and not supported, and explains how to identify a panel from the ribbon cable date code.

Verification

Flashed to real hardware with tinygo flash -target=pico -monitor. The panel rendered the complete pattern, which confirms SPI1 clock and data, the CS, DC, RST and BUSY pins, the IL3820 init sequence, and the RAM write. Serial output was:

clear the display
draw the test pattern
done, the display holds the image without power

gofmt is clean and tinygo build -target=pico succeeds.

One caveat worth flagging for reviewers: only the RP2040-PiZero with a V1 panel is marked as tested. The suggestion in the comment to try epd2in9v2 for SSD1680 panels is a starting point rather than a verified path, since that package targets a 2.9in panel and would need Width and Height overrides. I did not have the hardware to confirm it.

@davecheney

Copy link
Copy Markdown
Owner Author

Closing. This was opened against the fork by mistake. Reopened upstream as tinygo-org#890.

@davecheney davecheney closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant