From Waveshare Wiki
Jump to: navigation, search
 
(71 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
{{#tweekihide:firstHeading|sidebar-left|sidebar-right}}__NOTOC__
|brief=296x128, 2.9inch E-Ink display module
 
|img=[[File:2.9inch-e-paper-module-4.jpg|300px|link=http://www.waveshare.com/2.9inch-e-paper-module.htm]]
 
|caption=296x128, 2.9inch E-Ink display module, SPI interface
 
|category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]]
 
|brand=Waveshare
 
|{{#urlget:amazon|default}}=display
 
|website_cn=[http://www.waveshare.net/shop/2.9inch-e-paper-module.htm 官方中文站点]
 
|website_en=[http://www.waveshare.com/product/2.9inch-e-paper-module.htm Waveshare website]
 
|interface1=SPI
 
|related=
 
{{Product List|OLEDs / LCDs/e-Paper}}
 
}}
 
== Introduction ==
 
296x128, 2.9inch E-Ink display module, SPI interface
 
  
{{Amazon|{{#urlget:amazon|default}}=display
+
<div style="background-color: #343434;text-align: center;color: white;padding: 20px;margin: 8px;">
|More = [http://www.waveshare.com/product/2.9inch-e-paper-module.htm More]}}
+
=2.9inch e-Paper Module Manual=
== Interfaces ==
+
</div>
{|class="wikitable"
+
<p></p>
|-
+
{{ContentGrid|grid-gap=25px
| VCC || 3.3V
+
|content =
|-
+
{{StudyCard
| GND || GND
+
|img=[[File:E-Paper_Introduction_4.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Overview]]
|-
+
|heading = Introduction
| DIN || SPI MOSI
+
|content = Parameters, principles and precautions}}
|-
 
| CLK || SPI SCK
 
|-
 
| CS || SPI chip select (Low active)
 
|-
 
| DC || Data/Command control pin (High for data, and low for command)
 
|-
 
| RST || External reset pin (Low for reset)
 
|-
 
| BUSY || Busy state output pin (Low for busy)
 
|}
 
== Working principle ==
 
=== Introduction ===
 
This product is an E-paper device adopting the image display technology of Microencapsulated Electrophoretic Display, MED. The initial approach is to create tiny spheres, in which the charged color pigments are suspending in the transparent oil and would move depending on the electronic charge. The E-paper screen display patterns by reflecting the ambient light, so it has no background light requirement. Under sunshine, the E-paper screen still has high visibility with a wide viewing angle of 180 degree. It is the ideal choice for E-reading.
 
=== Communication protocol ===
 
[[File:1.54inch-e-paper-manual-1.png|400px|thumb|SPI timing]]
 
Note: Different from the traditional SPI protocol, the data line from the slave to the master is hidden since the device only has display requirement.  
 
* CS is slave chip select, when CS is low, the chip is enabled.
 
* DC is data/command control pin, when DC = 0, write command, when DC = 1, write data.
 
* SCLK is the SPI communication clock.
 
* SDIN is the data line from the master to the slave in SPI communication.
 
SPI communication has data transfer timing, which is combined by CPHA and CPOL.
 
# CPOL determines the level of the serial synchronous clock at idle state. When CPOL = 0, the level is Low. However, CPOL has little effect to the transmission.
 
# CPHA determines whether data is collected at the first clock edge or at the second clock edge of serial synchronous clock; when CPHL = 0, data is collected at the first clock edge.
 
* There are 4 SPI communication modes. SPI0 is commonly used, in which CPHL = 0, CPOL = 0.
 
As you can see from the figure above, data transmission starts at the first falling edge of SCLK, and 8 bits of data are transferred in one clock cycle. In here, SPI0 is in used, and data is transferred by bits, MSB first.
 
  
== How to use ==
+
{{StudyCard|img=[[File:Rapberry Pi.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Working_With_Raspberry_Pi]]
=== Working with Raspberry Pi ===
+
|heading = Working with Raspberry Pi
==== Installing libraries required ====
+
|content = User guides for the development demo of C language, Python}}
If you want to connect your E-paper screen to Raspberry Pi, you should install some necessary libraries, or else the [[:File:1.54inch_e-Paper_Module_code.7z|Demo (click to download)]] below may work improperly. For more information about how to install the Raspberry Pi libraries, please visit the website: [[Pioneer600#Libraries_Installation_for_RPi|Libraries Installation for RPi]].
 
  
You can find the detailed presentation about the installations of libraries wiringPi, bcm2835 and python.
+
{{StudyCard|img=[[File:Arduino00.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Working_With_Arduino]]
==== Hardware connection ====
+
|heading = Working with the Arduino
Here is the connection between Raspberry Pi 3B and E-paper.
+
|content = User guides for the development demo based on Arduino UNO R3}}
{|class="wikitable"
 
|-
 
! e-Paper !! Raspberry Pi 3B
 
|-
 
| 3.3V || 3.3V
 
|-
 
| GND || GND
 
|-
 
| DIN || MOSI
 
|-
 
| CLK || SCLK
 
|-
 
| CS || CE0
 
|-
 
| DC || 25
 
|-
 
| RST || 17
 
|-
 
| BUSY || 24
 
|}
 
==== Expected result ====
 
# After installed the corresponding libraries, you can copy the relative programs into your Raspberry Pi, and then enter the corresponding file.
 
#* '''BCM2835:''' Execute the command: <code>make</code>, to compile the code and generate a file <code>epd</code>. Execute the command: <code>sudo ./epd</code>, the program will run.  
 
#* '''WringPi:''' Execute the command: <code>make</code>, to compile the code and generate a file <code>epd</code>. Execute the command: <code>sudo ./epd</code>, the program will run.
 
#* '''Python:''' Execute the command: <code>sudo python main.py</code>
 
# Refreshes the whole screen and then displays strings and shapes.
 
# Refreshes the partial screen and then displays images and the time. This function demonstrates the partial refreshing capability.
 
=== Working with Arduino ===
 
==== Hardware connection ====
 
{|class="wikitable"
 
|-
 
! e-Paper !! Arduino
 
|-
 
| 3.3V || 3V3
 
|-
 
| GND || GND
 
|-
 
| DIN || D11
 
|-
 
| CLK || D13
 
|-
 
| CS || D10
 
|-
 
| DC || D9
 
|-
 
| RST || D8
 
|-
 
| BUSY || D7
 
|}
 
==== Expected result ====
 
# Copy the files from the directory arduino/libraries of the demo package to documents/arduino/libraries, where can be specified by Arduino IDE --> File --> Preferences --> Sketchbook location.
 
# Click the button '''Upload''' to compile and upload the program to your Arduino board.
 
# Refreshes the whole screen and then displays strings and shapes.
 
# Refreshes the partial screen and then displays images and the time. This function demonstrates the partial refreshing capability.
 
  
=== Working with the STM32 development board ===
+
{{StudyCard|img=[[File:Jetson Arduino00.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Working_With_Jetson_Nano]]
Here we use the development board XNUCLEO-F103RB. The Demo is base on the library HAL.
+
|heading = Working with the Jetson Nano
==== Hardware connection ====
+
|content = User guides for the development demo of C language, Python}}
Here is the hardware connection between the development board XNUCLEO-F103RB and E-paper:
 
{|class="wikitable"
 
|-
 
! e-Paper !! XNUCLEO-F103RB
 
|-
 
| 3.3V || 3V3
 
|-
 
| GND || GND
 
|-
 
| DIN || PA7
 
|-
 
| CLK || PA5
 
|-
 
| CS || PB6
 
|-
 
| DC || PC7
 
|-
 
| RST || PA9
 
|-
 
| BUSY || PA8
 
|}
 
==== Expected result ====
 
# Open the Keil project (MDK-ARM/epd-demo.uvprojx)
 
# Click '''Build''' to compile the project.
 
# Click '''Download''' to download the program to the target board.
 
# Refreshes the whole screen and then displays strings and shapes.
 
# Refreshes the partial screen and then displays images and the time. This function demonstrates the partial refreshing capability.
 
  
== Code analysis ==
+
{{StudyCard|img=[[File:Sunrise X3 Pi.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Working_With_Sunrise_X3_Pi]]
Here, we will analyze the driving code and take the demo of Raspberry Pi based on WiringPi library as examples.  
+
|heading = Working with Sunrise X3 Pi
=== Hardware interface function ===
+
|content = User guides for the development demo based on Python}}
The functions of drive code like DigitalWrite, DigitalRead, SendCommand, SenData and DelayMs call the interface functions which are provided by hardware device (epdif.h, epdif.c, epdif.cpp) to respectively implements the functions that Control IO Level, Read IO Level, Send SPI Command, Send SPI Data and Delay For Millisecond. If you want to port the demo code, you need to implement all the interfaces of epdif (e-paper display interface) according to the corresponding hardware device.
 
  
Note that Raspberry Pi uses hardware chip select while transmitting SPI data. So we needn’t set the CS pin to LOW before transmitting data, and the code will set it automatically while transmitting. However, for Arduino and STM32, etc. you need to explicitly set the CS pin to LOW with codes to start the SPI transmission of module.
+
{{StudyCard|img=[[File:STM321.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Working_With_STM32]]
=== Send Commands and Data (SendCommand and SendData) ===
+
|heading = Working with the STM32
SendCommand and SendData are used to send commands and data to module respectively. What the difference between them is that, D/C pin is set to LOW for sending commands and HIGH for sending data. If the D/C pin is LOW, the data transmitted from SPI interface to module will be recognized as commands and executed. If the D/C pin is HIGH, the data will be recognized as normal data. Generally, normal data will follow the command, works as parameter or image data.
+
|content = User guides for the development demo based on STM32CubeMX}}
=== Reset (Reset) ===
 
Module will reset if RST pin is LOW. It is used to restart the module after power on or wake it up from sleep mode. After restarting, you need to initialize module with initialization function (Init) for working properly.
 
=== Initialization (Init) ===
 
Init has 3 effects:
 
# Set the arguments at power up.
 
# Awaken the module from deep sleep.
 
# Set the mode to Full update or Partial update.
 
Process of initialization: reset --> driver output control --> booster soft start control --> write VCOM register --> set dummy line period --> set gate time --> data entry mode setting --> look-up table setting
 
  
=== Configuration of LUT table(SetLut) ===
+
{{StudyCard|img=[[File:E-Paper_ESP32.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#ESP32.2F8266]]
Look-up table is used to set the update mode of the module. This table is provided by us but it may be different among different batches. If the table changed, we will update the demo code as soon as possible.  
+
|heading = Working with ESP32/8266
=== Set the frame memory (SetFrameMemory) ===
+
|content = User guides for ESP32/8266}}
SetFrameMemory is used to write image data to the memory.
 
* Process:  
 
:: Set the area size (see the function SetMemoryArea) --> set the start point (see the function SetMemoryPointer) --> send the command ''Write RAM'' --> start image data transfer.  
 
* The module has two memory areas. Once DisplayFrame is invoked, the following function SetFrameMemory will set the other memory area, e.g. to set all the two memory areas, the process is: SetFrameMemory --> DisplayFrame --> SetFrameMemory --> DisplayFrame, i.e. set and update twice.
 
* The data from SPI interface is first saved into the memory and then updated if the module received the update command.
 
* About the image to be sent: 1 byte = 8 pixels, doesn’t support Gray scale (Can only display black and white). A bit set stands for a white pixel, otherwise a bit reset stands for a black pixel.
 
For example:
 
<pre>
 
0xC3:8 pixels □□■■■■□□
 
0x00:8 pixels ■■■■■■■■
 
0xFF:8 pixels □□□□□□□□
 
0x66:8 pixels ■□□■■□□■
 
</pre>
 
=== Display a Frame (DisplayFrame) ===
 
DisplayFrame is used to display the data from the frame memory.
 
  
Note:
+
{{StudyCard|img=[[File:Resource0.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Resources]]
* The module has two memory areas. Once DisplayFrame is invoked, the following function SetFrameMemory will set the other memory area, e.g. to set all the two memory areas, the process is: SetFrameMemory --> DisplayFrame --> SetFrameMemory --> DisplayFrame, i.e. set and update twice.
+
|heading = Resources
* The data from SPI interface is first saved into the memory and then updated if the module received the update command.
+
|content = Documentation, procedures and data sheets, etc}}
* The module will flicker during full update.
 
* The module won't flicker during partial update, however, it may retain a "ghost image" of the last page.
 
=== Sleep mode (Sleep) ===
 
Sleep can make the module go into sleep mode to reduce the consumption.
 
  
If you want to wake up the module from sleep mode, you need to give a LOW pulse to RST pin. Then maybe you need to reconfigure the parameter of power (According to the batches, some of them need to reconfigure, some needn’t). So if you want to wake up module, you had better use the Init function instead of Reset. Reset function and relative commands will be executed while executing the Init function.
+
{{StudyCard|img=[[File:FAQ01.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#FAQ]]
=== Private function: Set the memory area (SetMemoryArea) ===
+
|heading = FAQ
SetMemoryArea is used to specify the memory area, the arguments are the start/end points. Because 1 byte = 8 pixels of the image data to be sent, the x coordinates must be the multiple of 8, or else the last 3 bits will be ignored.
+
|content = e-Paper frequently asked questions}}
=== Private function: Set the memory pointer (SetMemoryPointer) ===
 
SetMemoryPointer is used to set the start point of the following image to be sent. Because 1 byte = 8 pixels of the image data to be sent, the x coordinates must be the multiple of 8, or else the last 3 bits will be ignored.
 
=== How to display an image ===
 
There are two ways to display pictures. One is display directly and other is indirectly.
 
  
Display directly: Read the data of pictures with library functions, and decode. Then convert it to arrays and send to module. About how to implement it, you can refer to the python examples of Raspberry Pi. (The C demo doesn’t display pictures directly)
+
{{StudyCard|img=[[File:support00.jpg|110px|link=https://www.waveshare.com/wiki/2.9inch_e-Paper_Module_Manual#Support]]
 
+
|heading = Support
Display indirectly: Converting pictures to relative arrays on PC and save as c file. Then you can use the c file on your project. This chapter we will talk about how to convert a picture to array.
+
|content = Technical support
 
+
}}
# Open a picture with drawing tool comes with Windows system, create a new image, and set the pixel to 128x296.
+
}}
# Because this module can only display two gray level (Only black and white), we need to convert picture to monochrome bitmap before converting it to array. That is, File --> BMP picture --> Monochrome Bitmap.
 
#: There are two monochrome bitmap on examples pack, which are used for demonstration (raspberrypi/python/black.bmp and raspberrypi/python/red.bmp).
 
# Use Image2Lcd.exe software to generate corresponding array for picture (.c file). Open picture with this software, set the parameters:
 
#* Output data type: C language array
 
#* Scanning mode: vertical scanning
 
#* Output gray: single color (gray level of two)
 
#* Maximum width and height: 128 and 296
 
#* Include the data of Image Header: Don’t check
 
#* Inverse color: Check (Check: the white on image will be converted to 1, and black is converted to 0)
 
# Click '''Save''', to generate .c file. Copy the corresponding array into your project, and you can display picture by calling this array.
 
 
 
[[File:1.54inch-e-paper-manual-3.png|400px]]
 
 
 
[[File:1.54inch-e-paper-manual-4.png|400px]]
 
 
 
== Resources ==
 
=== Documentation ===
 
* [[:File:2.9inch_e-Paper_Schematic.pdf|Schematic]]
 
=== Demo code ===
 
* [[:File:2.9inch_e-Paper_Module_code.7z|Demo code]]
 
=== Datasheets ===
 
* [[:File:1.54inch_e-Paper_Datasheet.pdf|1.54inch_e-Paper_Datasheet.pdf]]
 
* [[:File:2.13inch_e-Paper_Datasheet.pdf|2.13inch_e-Paper_Datasheet.pdf]]
 
* [[:File:2.9inch_e-Paper_Datasheet.pdf|2.9inch_e-Paper_Datasheet.pdf]]
 
 
 
==Support==
 
{{Service00}}
 

Latest revision as of 06:15, 24 March 2023


2.9inch e-Paper Module Manual

E-Paper Introduction 4.jpg

Introduction

Parameters, principles and precautions
Rapberry Pi.jpg

Working with Raspberry Pi

User guides for the development demo of C language, Python
Arduino00.jpg

Working with the Arduino

User guides for the development demo based on Arduino UNO R3
Jetson Arduino00.jpg

Working with the Jetson Nano

User guides for the development demo of C language, Python
Sunrise X3 Pi.jpg

Working with Sunrise X3 Pi

User guides for the development demo based on Python
STM321.jpg

Working with the STM32

User guides for the development demo based on STM32CubeMX
E-Paper ESP32.jpg

Working with ESP32/8266

User guides for ESP32/8266
Resource0.jpg

Resources

Documentation, procedures and data sheets, etc
FAQ01.jpg

FAQ

e-Paper frequently asked questions
Support00.jpg

Support

Technical support