martinberlin/CalEPD

Unable to get the display working

DimitriLubenski opened this issue · 3 comments

Dear all,

After the successfull implementation using arduino studio I would like to move to ESP-IDF.

I have following hardware:

ESP32 SKU 15823
Waveshare 800×480, 7.5inch E-Ink raw display SKU 15823

I use VSCode with ESP-IDF Plugin. I am able to compile and flash the project and does not have any exception in the output while executing the test code on the ESP32 (see below), though I dont see any output on the screen. Do you have a hint what else shall I check? May be some additional driver / SPI configuration has to be adopted?

'
I (312) spi_flash: flash io: dio
CalEPD component version 1.0.6
Gdew075T7() constructor injects IO and extends Adafruit_GFX(800,480) Pix Buffer[48000]

Available heap after Epd bootstrap:133776
I (331) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
CalEPD version: 1.0.6
EpdSPI started at frequency: 4000000
Sending a 48000 bytes buffer via SPI
'

`#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include <Gdew075T7.h>
#include <Fonts/ubuntu/Ubuntu_M18pt8b.h>

EpdSpi io;
Gdew075T7 display(io);

extern "C" {
void app_main(void);
}

void delay(uint32_t millis) { vTaskDelay(millis / portTICK_PERIOD_MS); }

void app_main(void)
{

printf("CalEPD version: %s\n", CALEPD_VERSION);
// Test Epd class
display.init(false);

//display.setRotation(2);
//display.update();return;
//delay(1000);

uint8_t rectW = display.width()/4; // For 11 is 37.

uint16_t foregroundColor = EPD_WHITE;
// First does not work
display.fillScreen(EPD_BLACK);
display.update();

//return;
display.fillScreen(EPD_WHITE);
uint16_t firstBlock = display.width()/4;
display.fillRect( 1,1,rectW, firstBlock,foregroundColor);
display.fillRect(rectW,1,rectW, firstBlock,EPD_WHITE);
display.fillRect(rectW2,1,rectW,firstBlock,foregroundColor);
display.fillRect(rectW
3,1,rectW-2,firstBlock,EPD_WHITE);

display.fillRect( 1,firstBlock,rectW,firstBlock,EPD_BLACK);
display.fillRect(rectW,firstBlock,rectW,firstBlock,foregroundColor);
display.fillRect(rectW2,firstBlock,rectW,firstBlock,EPD_BLACK);
display.fillRect(rectW
3,firstBlock,rectW-2,firstBlock,foregroundColor);

display.setCursor(display.width()/2-130,display.height()-90);
display.setTextColor(EPD_WHITE);
display.setFont(&Ubuntu_M18pt8b);
display.println("BERLIN");
display.setTextColor(EPD_BLACK);
display.println("demo-epaper.cpp full update is done!");
display.update();
// Leave the epaper White ready for storage
// delay(2000);
// display.fillScreen(EPD_WHITE);
display.update();
return;

}
`

hello_world.zip

Attaching the project just in case.

I found the issue and would like to update the community if someone is tapping into it. I had to configure the output pins accoring to the hardware vendor driver

Here is the code of the Wavesahre DEV_config.h:

`
/**
GPIO config
**/
#define EPD_SCK_PIN 13
#define EPD_MOSI_PIN 14
#define EPD_CS_PIN 15
#define EPD_RST_PIN 26
#define EPD_DC_PIN 27
#define EPD_BUSY_PIN 25

#define GPIO_PIN_SET 1
#define GPIO_PIN_RESET 0
`

In ESP-IDF you can use

idf.py menuconfig (Display Configuration)

image

which adds/modifies following data in sdkconfig

`

Mosi and Clock should be set for any epaper

CONFIG_EINK_SPI_MOSI=14
CONFIG_EINK_SPI_CLK=13
CONFIG_EINK_SPI_CS=15
CONFIG_EINK_DC=27
CONFIG_EINK_RST=26
CONFIG_EINK_BUSY=25
`

Great that it worked out for you Dimitri. If you like the component add a Star so you can have it in your starred list. Thanks!