Skip to content

Communicate with 2.9" DKE ePaper Module using SPI interface of ESP32 and ESP-IDF or Arduino

License

Notifications You must be signed in to change notification settings

krzychb/esp-epaper-29-dke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2.9" Waveshare ePaper Driver Example

Communicate with 2.9" DEPG0290B0 ePaper Module by DKE Group using SPI interface of ESP32 and ESP-IDF or Arduino.

This driver has been developed as preparation for esp32-everest-run-badge project.

Check driver for a similar size display esp-epaper-29-ws by Waveshare.

About

ePaper displays are great for low power applications. They do not need much energy when operated. They retain the last image at zero energy consumed. You can buy them cheaply as they are produced in high volumes to be used in stores as electronic shelf labels. If your do not need fast update of displayed information, go ahead and use ePaper display for your project! This is what I decided to do. Unfortunately I could not find a driver that would easy integrate into my code. Also documentation how to drive them is still somewhat obscure (December 2017). Fortunately with help of great resources mentioned in Credits I was able to develop the driver I was looking for.

alt text alt text
Sample screen with graphics / Arduino driver Sample screen with graphics / Arduino driver
alt text alt text
Sample screen with graphics / ESP-IDF driver Sample screen with graphics / ESP-IDF driver

How to run this example

Arduino

The quickest way check this software in action is in Arduino environment. It should work with all Arduino boards that have SPI interface. Some concern may be the size of memory to store the image. To display the full memory buffer you need 4736 bytes of RAM. If you do not have enough memory, then you can update display where it changed, using smaller chunks of memory. As this project is oriented to use ESP32 chip, there is no concern, it has more than enough RAM. To load the application use instructions in espressif/arduino-esp32 repository.

ESP-IDF

To use the example code with ESP-IDF framework, please follow ESP32 Get Started.

Wiring of ePaper Module used in example code

Signal Name ePaper Module ESP32
Module Busy BUSY GPIO22
Reset RST GPIO23
Data / Command DC GPIO21
Slave Select CS GPIO19
Serial Clock CLK GPIO18
Master Out Slave In DIN GPIO5
Ground GND GND
Power Supply 3.3V 3V3

Example log output

Arduino

Application 'epd2in9-badge.ino' started
Hardware reset done.
Writing LUT done.
Clearing frame memory done.
Displaying frame............. done.
Writing LUT done.
Writing frame memory done.
Displaying frame............. done.
Displaying frame............. done.
Displaying frame............. done.

ESP-IDF

I (254) ePaper Example: Starting example
I (254) ePaper Example: Before ePaper driver init, heap: 297848
I (274) ePaper Example: e-Paper Display Espressif logo
I (274) ePaper Driver: SPI data sent 70
I (274) ePaper Driver: SPI data sent 4736
I (474) ePaper Driver: SPI data sent 70
I (474) ePaper Driver: SPI data sent 4736
I (6734) ePaper Example: e-Paper Display sample graphics
I (6794) ePaper Driver: SPI data sent 70
I (6804) ePaper Driver: SPI data sent 4736
I (8064) ePaper Example: EPD Display update count: 0
I (8064) ePaper Example: After ePaper driver delete, heap: 302288

Build Status

Build Status

Documentation for ESP-IDF

Documentation Status

ESP-IDF Usage Notes

Changes to the original driver

I have discovered that there are plenty of similar e-paper displays on the market that look exactly the same, but require some modifications in the driver code. In my case I have modified the following:

  • Display initialization sequence in function iot_epaper_spi_init()
  • LUT tables, they differ in size and quantity and dictate how the image is "developed" on the screen
  • Commands to to configure image data transfer to the display, two extra functions have been added - iot_set_ram_area() and iot_set_ram_address_counter().
  • Commands to show up the image
  • Other minor things like configuration of checking the BUSY signal, command to put the ePaper into sleep mode, display resolution, etc.

Optimizing the SPI communication

I have decided to make some updates to the SPI code in original epaper component. In particular I have configured DMA transfer instead of sending image data byte by byte. Also I have removed pre and post transfer delays.

Converting pictures

To convert an exiting image to the C header file, use an application recommended by Waveshare in their Wiki. See a picture below what parameters to set. I have discovered that you need to mirror the image and this was not documented in the Wiki.

alt text

Contribute

Feel free to contribute to the project in any way you like!

If you find any issues with code or description please report them using Issues tab above.

Credits

This repository has been prepared thanks to great work of the following teams and individuals:

  • Espressif team that develops and maintains esp-idf repository
  • esp-iot-solution team that developed cleanly coded epaper component for another type of display
  • SHA2017 Badge Team, love the hardware and the software you have carefully designed and implemented for SHA2017!
  • Waveshare that provides great documentation and demo code for various displays they supply

License

Apache License Version 2.0, January 2004

About

Communicate with 2.9" DKE ePaper Module using SPI interface of ESP32 and ESP-IDF or Arduino

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published