Skip to content
ESP32s.com
0$0.00

ESP32 E-Paper Framebuffers: RAM, PSRAM & Paged Drawing

An e-paper framebuffer stores pixels in memory; the panel driver decides how they are transferred and refreshed. Calculate the drawing buffer separately from the physical refresh behavior, then check the library’s allocation and paging model.

Calculate the pixel storage

A tightly packed monochrome 1-bit buffer needs approximately width × height / 8 bytes, with rounding for row alignment. An 800 × 480 image needs 48,000 bytes at one bit per pixel. A second bit plane, color encoding, padding or additional canvas changes that requirement.

Example canvas Encoding assumption Pixel bytes before extra overhead
296 × 128 1 bit/pixel 4,736
400 × 300 1 bit/pixel 15,000
800 × 480 1 bit/pixel 48,000
800 × 480 Two 1-bit planes 96,000
800 × 480 4 bits/pixel 192,000

These are arithmetic examples, not the exact allocation of every library or color panel. Code, fonts, networking, JSON parsing and other buffers also need memory. A color display does not automatically require a full RGB framebuffer.

Paged drawing can reduce the working buffer

GxEPD2 supports paged drawing for supported displays. The application draws the intended scene repeatedly while the library transfers successive pages. Keep the drawing operation deterministic: capture the sensor value, timestamp or text before the page loop so the same image is used for all pages.

A page buffer is a memory-management choice. It does not imply that the panel supports a partial physical refresh, or that only the drawn page will visibly update.

When PSRAM helps

PSRAM can provide space for larger data structures when the board, framework and library support those allocations. It does not replace every internal memory requirement. Before changing hardware, check free heap, allocation failures, buffer placement and whether a smaller page buffer is suitable.

Plan a simple first layout

  1. Start with the exact panel class and a static border/text example.
  2. Keep fonts, bitmap encoding and color constants compatible with the selected library.
  3. Read back the final image dimensions and rotation before converting bitmaps.
  4. Add networking after the drawing path works.

For panel selection and wiring use the e-paper integration guide. For physical partial updates use the refresh and ghosting guide; for battery estimates use the measured power-budget guide. See 2.9-inch E-Paper: GDEY029T94 / ESP32 and 4.2-inch E-Paper: GDEY042T81 / ESP32 for specific examples.

References