From Waveshare Wiki
Jump to: navigation, search
 
(96 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
{{#tweekihide:firstHeading|sidebar-left|sidebar-right}}__NOTOC__
|brief=200x200, 1.54inch E-Ink display module
 
|img=[[File:1.54inch-e-paper-module-6.jpg|300px|link=http://www.waveshare.com/1.54inch-e-Paper-Module.htm]]
 
|caption=200x200, 1.54inch 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/1.54inch-e-Paper-Module.htm 官方中文站点]
 
|website_en=[http://www.waveshare.com/product/1.54inch-e-Paper-Module.htm Waveshare website]
 
|interface1=SPI
 
|related=
 
{{Product List|OLEDs / LCDs/e-Paper}}
 
}}
 
== Introduction ==
 
200x200, 1.54inch 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/1.54inch-e-Paper-Module.htm More]}}
+
=1.54inch 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/1.54inch_e-Paper_Module_Manual#Introduction]]
|-
+
|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 Electropho-retic 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 hided 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 serial synchronous clock is Low. However, CPOL has little effect to the transmission protocol.
 
# 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 failing 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/1.54inch_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 Demos below may work improperly. For more information about how to install the Raspberry Pi libraries, please visit the website: http://www.waveshare.net/wiki/Pioneer600_Datasheets
 
  
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/1.54inch_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
 
|}
 
==== Compiling project ====
 
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: make, to compile the code and generate a file main.exe. Execute the command: sudo./main, the program will run.
 
* '''WringPi:''' Execute the command: make, to compile the code and generate a file main.exe. Execute the command: sudo./main, the program will run.
 
* '''Python:''' Execute the command: sudo python main.py
 
==== Expected result ====
 
# Refresh the whole screen
 
# Refresh part of the screen
 
# Display the Logo of Waveshare
 
# Draw cycles and lines, display two different sizes of characters
 
# Display progress bar and time. This function can demonstrate 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 ====
 
Since the development board UNO PLUS only has 2Kb storage space for global variables, the image display example is not provided in the Demos. When working with UNO PLUS, the method for calling the image display program is the same as the one when working with other main board. Because of the inadequate storage space for global variables, there is no Demo about image display here.
 
# Drawing: cycle and line only;
 
# String: display characters;
 
[[File:1.54inch-e-paper-manual-2.png|400px]]
 
=== Working with the development board STM32 ===
 
Here we use the development board XNUCLEO-F103RB. The Demo is base on the library HAL.
 
==== Hardware connection ====
 
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 ====
 
# Refresh the whole screen
 
# Refresh part of the screen
 
# Display the Logo of Waveshare
 
# Draw cycles and lines, display two different sizes of characters
 
# Display progress bar and time. This function can demonstrate the partial refreshing capability.
 
== Code analysis ==
 
We will analyze the driving code by taking the Demos of the Raspberry Pi library BCM2835 as examples. The Demos support three different screens, including 1.54 inch, 2.13 inch and 2.9 inch. If you want to port the demo to a new hardware or modify it, please find out the one of the module you need and modify the corresponding macro.
 
  
1) Initialization:
+
{{StudyCard|img=[[File:Jetson Arduino00.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#Working_With_Jetson_Nano]]
Reset the screen directly:
+
|heading = Working with the Jetson Nano
<pre>
+
|content = User guides for the development demo of C language, Python}}
EPD_RST_0; // Module reset
 
driver_delay_xms(100);
 
EPD_RST_1;
 
driver_delay_xms(100);
 
</pre>
 
Then, send out the initialization screen data stored at the register:
 
<pre>
 
EPD_Write(GDOControl, sizeof(GDOControl)); //GDO control
 
EPD_Write(softstart, sizeof(softstart));  //soft start
 
EPD_Write(VCOMVol, sizeof(VCOMVol));  //VCOM voltage
 
EPD_Write(DummyLine, sizeof(DummyLine));..//dummy line
 
EPD_Write(Gatetime, sizeof(Gatetime));  //gate time
 
EPD_Write(RamDataEntryMode, sizeof(RamDataEntryMode));  //set RAM
 
EPD_SetRamArea(0x00,(xDot-1)/8,(yDot-1)%256,(yDot-1)/256,0x00,0x00);  //set RAM area
 
EPD_SetRamPointer(0x00,(yDot-1)%256,(yDot-1)/256);  //set RAM pointer
 
</pre>
 
In another word, set the comparison voltage and the size of the whole screen.
 
  
2) Set LUT register:
+
{{StudyCard|img=[[File:Sunrise X3 Pi.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#Working_With_Sunrise_X3_Pi]]
The E-paper screen has two refresh modes, full screen refresh and partial screen refresh.
+
|heading = Working with Sunrise X3 Pi
<pre>
+
|content = User guides for the development demo based on Python}}
EPD_WirteLUT((unsigned char *)LUTDefault_full,sizeof(LUTDefault_full));
 
</pre>
 
The difference is that the parameters LUTDefault for two modes are two different values;
 
  
After setting the basic register, you can go to the next part, display data transmission.
+
{{StudyCard|img=[[File:STM321.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#Working_With_STM32]]
Clear the whole screen:  
+
|heading = Working with the STM32
<pre>
+
|content = User guides for the development demo based on STM32CubeMX}}
EPD_WriteDispRamMono(xDot, yDot, 0xff);
 
</pre>
 
Global display data:
 
<pre>
 
EPD_WriteDispRam(xDot, yDot, (unsigned char *)DisBuffer);
 
</pre>
 
For partial screen display, there are many commands should be used.
 
<pre>
 
part_display(xStart/8,xEnd/8,yEnd%256,yEnd/256,yStart%256,yStart/256);// set the address start/end bit of RAM X and Y, and the address counter of RAM X and Y.
 
EPD_WriteDispRamMono(xEnd-xStart, yEnd-yStart+1, DisBuffer); //the data on display buffers are written into a same display area.
 
EPD_Update_Part(); //Display update
 
driver_delay_xms(500); part_display(xStart/8,xEnd/8,yEnd%256,yEnd/256,yStart%256,yStart/256);
 
EPD_WriteDispRamMono(xEnd-xStart, yEnd-yStart+1, DisBuffer);
 
</pre>
 
For partial refresh, it need a 0.5s delay before writing the same data into the display area.
 
  
== About code porting and compatibility ==
+
{{StudyCard|img=[[File:E-Paper_ESP32.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#ESP32.2F8266]]
The provided Demo can be compatible to three kinds of screen. The main difference among them is that the display area size to be initialized, the time for stable display after partial refresh, and the value written into LUT register are all different.
+
|heading = Working with ESP32/8266
 +
|content = User guides for ESP32/8266}}
  
You can select the initialization setting you want by defining corresponding macro.
+
{{StudyCard|img=[[File:Resource0.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#Resources]]
 +
|heading = Resources
 +
|content = Documentation, procedures and data sheets, etc}}
  
The macros EPD2X9, EPD02X13 and EPD1X54 are corresponding to 2.9 inch screen, 2.13 inch screen and 1.54 inch screen, respectively. By setting the corresponding macro to 1 or 0, you can select the initialization setting you need.
+
{{StudyCard|img=[[File:FAQ01.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#FAQ]]
For example
+
|heading = FAQ
<pre>
+
|content = e-Paper frequently asked questions}}
#define EPD2X9 0
 
#define EPD02X13 0
 
#define EPD1X54 1
 
</pre>
 
Select the initialization configuration of 1.54 inch screen, and save the modification. Then, the program will display corresponding configuration and proper size of Logo on the screen.
 
* Notes: Both EPD_drive.c and Display_Lib.h should be set. The former is a driver, and the later is a display library.
 
== Image making ==
 
This module only supports the images with the gray level of two (Black and white). For the image with many gray levels, it cannot display all the colors.
 
  
1) Find an image with the gray level of two, and you can make one with a drawing tool on your PC.
+
{{StudyCard|img=[[File:support00.jpg|110px|link=https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_Manual#Support]]
 
+
|heading = Support
2) Modify the image resolution with the drawing tool in your system.
+
|content = Technical support
 
+
}}
Besides the drawing tool in your system, other graphing tools, such as Photoshop, can be used to modify the image resolution.
+
}}
 
 
[[File:1.54inch-e-paper-manual-3.png|400px]]
 
 
 
3) Use the software Image2Lcd.exe to generate an array for the image (a file with .c extension), as the figure shows below:
 
 
 
[[File:1.54inch-e-paper-manual-4.png|400px]]
 
 
 
Open the image in this software, and 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: the size of pixel
 
* Inverse color: check
 
Save the modification, you will get an array for the image in a file with .c extension. Copy the corresponding values into your project, then, you can display the image by calling this array.
 
 
 
== Resources ==
 
=== Documentation ===
 
* [[:File:1.54inch_e-Paper_Schematic.pdf|Schematic]]
 
=== Demo code ===
 
* [[:File:1.54inch_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 02:52, 23 March 2023


1.54inch 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