Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit 2.7" eInk and the EInkBreakouts example
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit 2.7" eInk and the EInkBreakouts example

by Saps on Tue Mar 24, 2020 5:35 pm

I have an arduino UNO and the tricolor 2.7" breakout (4098)

I am trying to understand how the EInkBreakouts example is supposed to work.

When this code is compiled:
Sketch uses 23980 bytes (74%) of program storage space. Maximum is 32256 bytes.
Global variables use 1460 bytes (71%) of dynamic memory, leaving 588 bytes for local variables. Maximum is 2048 bytes.


The sample image is 212x104 or ~22K, so when it tries to load the image off of the SD card it gets returns:

Drawing canvas to EPD...Initializing filesystem...SD begin()OK!
Loading tricolor-blinka.bmp to canvas...Malloc failed (insufficient RAM).
Drawing canvas to EPD...


Which makes sense 22K is a lot bigger than 600 bytes
I've tracked this down to Adafruit_ImageReader.cpp line 426

if ((depth == 24) || (depth == 1)) { // BGR or 1-bit bitmap format

if (img) {
// Loading to RAM -- allocate GFX 16-bit canvas type
status = IMAGE_ERR_MALLOC; // Assume won't fit to start
if (depth == 24) {
if ((img->canvas.canvas16 = new GFXcanvas16(bmpWidth, bmpHeight))) {
dest = img->canvas.canvas16->getBuffer();
}
} else {


How is that supposed to work? I know the Breakout board has SRAM (haven't found the specs on how much) and the SRAM is what is supposed to be used for images. but how does "new" know to use that space? Because right now it is not.

I have created a tiny bmp (<600 bytes) and that gets displayed so I know everything else is functional.

Saps
 
Posts: 5
Joined: Thu Mar 19, 2020 1:12 pm

Re: Adafruit 2.7" eInk and the EInkBreakouts example

by Saps on Wed Apr 01, 2020 9:05 am

As I suspected the sample code does not use the added ram on the eInk breakout board. In my opinion this makes it a rather useless example.

Anyway I have created my own specialized driver that only is only 5K and only 600 bytes of dynamic memory. It is rather specialized so not sure if anyone is interested in it.

My driver takes a texted based array (hardcoded for now) moves it to the eInk breakout board ram. Then converts it to a BW image to display on the eInk.

for example:
Sent MSG Binary of message Image
AA AA -> 1010 1010 1010 1010 -> XOXOXOXOXOXOXOXO
5F 05 -> 0101 1111 0000 0101 -> OXOXXXXXOOOOOXOX

Saps
 
Posts: 5
Joined: Thu Mar 19, 2020 1:12 pm

Please be positive and constructive with your questions and comments.