1
\$\begingroup\$

I am trying to understand how to drive an E-Ink display like the Adafruit 4196 with i.e. an Atmega328 with avr-libc.

From what I could learn so far, I would write the image/text to a frame buffer and push it to the display when done. Because the 8k frame buffer needed for the 200x200 pixel monochrome display is way too large for the 2k SRAM of the Atmega328, I would create the frame buffer in an external SRAM via SPI, and when done, push it from the SRAM to the display. The Adafruit 4196 already includes an SRAM.

Adafruit has a library for Arduino which depends on Adafruit GFX allowing to render text and so on, so I guess all this would have to be implemented with "plain" avr-libc.

Did I get that right so far? Isn't all that quite a lot of work even for just displaying some plain text? Are there any libraries that could be useful here, like probably this one for SPI?

\$\endgroup\$
6
  • \$\begingroup\$ Since you anyway have to generate the graphics for the display, and it must be written to the display, why not simply write to the display directly, without a frame buffer? What would be the benefit of having a frame buffer? \$\endgroup\$
    – Justme
    Mar 19 at 16:49
  • \$\begingroup\$ It is what I understood from the description of the Adafruit 4196. They also mention an SRAM - do they mean the on-chip RAM of the SSD1681 display driver? So can I write pixel by pixel to that RAM via SPI and tell the driver to display when done? \$\endgroup\$ Mar 19 at 17:11
  • \$\begingroup\$ No the Adafruit product has separate memory chip which is not related in any way to the display but their code just uses it as a separate frame buffer to copy data aroud. It reads on the product description page. \$\endgroup\$
    – Justme
    Mar 19 at 17:35
  • \$\begingroup\$ Thanks, I am just wondering why they add a separate SRAM if they could just use the RAM of the display driver? \$\endgroup\$ Mar 19 at 19:30
  • \$\begingroup\$ You should ask them. Maybe they just want to offer a frame buffer even on MCUs with no memory for a frame buffer, like they say on their web page. \$\endgroup\$
    – Justme
    Mar 19 at 19:43

1 Answer 1

1
\$\begingroup\$

You don't specifically need a frame buffer. That specific module just offers you one in the form of external SPI bus SRAM chip. You don't have to or need use it as a frame buffer or for anything if you don't want to, but since the Adafruit module includes it, the Adafruit code driver will use it.

If you want to just send strings of text to the display, you can do so without a frame buffer.

But the display does not work with text, it works with pixels that may contain anything.

So you still need to store a bitmap pixel font on your MCU, for example a 8x8 bitmap for 128 ASCII characters takes one kilobyte. But when you have the font, the 200x200 display can show 25x25 characters, and you only need 625 bytes of RAM to store 25x25 characters if you need to store them.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, nice answer, I understand now. I suppose I could store that bitmap pixel font in program memory so I still have 2K of RAM. Curious if I manage to drive that display... \$\endgroup\$ Mar 19 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.