Skip to content

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

Merged
conejoninja merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-epd2in13-pizero-demo
Sep 10, 2026
Merged

examples: add 2.13in e-Paper V1 demo for RP2040-PiZero#890
conejoninja merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-epd2in13-pizero-demo

Conversation

@davecheney

@davecheney davecheney commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

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

IMG_2514

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.

Comment thread examples/waveshare-epd/epd2in13-pizero/main.go Outdated
Exercise all four SetRotation modes in the demo. Fix epd2in13.Size(),
which reported the padded logical buffer width instead of the true
panel width at rotation 90 and 270. This clipped the last few rows on
those rotations because the driver bounds check used the true width
while Size() reported the padded width.

Scale the dither ramp and solid block to the panel height instead of
fixed pixel offsets, so they fit inside the shorter 122 pixel dimension
at rotation 90 and 270.
@davecheney
davecheney force-pushed the davecheney-epd2in13-pizero-demo branch from 19e7293 to 251903e Compare September 10, 2026 02:53
@davecheney

Copy link
Copy Markdown
Contributor Author

@conejoninja PTAL, i also verified rotation was working

IMG_2519.MOV

@conejoninja

Copy link
Copy Markdown
Member

Thanks for your contribution! Merged

@conejoninja
conejoninja merged commit 3b4cdec into tinygo-org:dev Sep 10, 2026
1 check passed
@davecheney
davecheney deleted the davecheney-epd2in13-pizero-demo branch September 10, 2026 08:50
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.

2 participants