Difference between revisions of "1.54inch e-Paper Module"

From Waveshare Wiki
Jump to: navigation, search
(Expected result)
(Certification)
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
{{Infobox item
|brief=200x200, 1.54inch E-Ink display module
+
|name=1.54inch e-Paper
|img=[[File:1.54inch-e-paper-module-6.jpg|300px|link=http://www.waveshare.com/1.54inch-e-Paper-Module.htm]]
+
|name2=1.54inch e-Paper Module
|caption=200x200, 1.54inch E-Ink display module, SPI interface
+
|img=[[File:1.54inch-e-Paper-1.jpg|300px|link=https://www.waveshare.com/1.54inch-e-Paper.htm]]
 +
|img2=[[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 raw panel
 +
|caption2=200x200, 1.54inch E-Ink display module, SPI interface
 
|category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]]
 
|category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]]
 
|brand=Waveshare
 
|brand=Waveshare
Line 13: Line 16:
 
}}
 
}}
 
== Introduction ==
 
== Introduction ==
 +
<!-- {{e-Paper Raw Panel}}-->
 +
'''Note:''' Please read the user manual before you using the e-paper
 +
 
200x200, 1.54inch E-Ink display module, SPI interface
 
200x200, 1.54inch E-Ink display module, SPI interface
  
 
{{Amazon|{{#urlget:amazon|default}}=display
 
{{Amazon|{{#urlget:amazon|default}}=display
 
|More = [http://www.waveshare.com/product/1.54inch-e-Paper-Module.htm More]}}
 
|More = [http://www.waveshare.com/product/1.54inch-e-Paper-Module.htm More]}}
 +
===Video===
 +
<youtube height=400px, width=400px>https://youtu.be/-XbwDC2AOOw</youtube>
 +
<!--
 
== Interfaces ==
 
== Interfaces ==
 
{|class="wikitable"
 
{|class="wikitable"
Line 74: Line 83:
 
| CS || CE0
 
| CS || CE0
 
|-
 
|-
| DC || 25
+
| DC || Pin22/GPIO25
 
|-
 
|-
| RST || 17
+
| RST || Pin11/GPIO17
 
|-
 
|-
| BUSY || 24
+
| BUSY || Pin18/GPIO24
 
|}
 
|}
==== 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: <code>make</code>, to compile the code and generate a file <code>main</code>. Execute the command: <code>sudo ./main</code>, the program will run.
+
* '''WringPi:''' Execute the command: <code>make</code>, to compile the code and generate a file <code>main</code>. Execute the command: <code>sudo ./main</code>, the program will run.
+
* '''Python:''' Execute the command: <code>sudo python main.py</code>
+
 
==== Expected result ====
 
==== Expected result ====
# Refresh the whole screen
+
# After the corresponding libraries installed, you can copy the relative programs into your Raspberry Pi, and then enter the corresponding file.
# Refresh part of the screen
+
#* '''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.
# Display the Logo of Waveshare
+
#* '''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.
# Draw cycles and lines, display two different sizes of characters
+
#* '''Python:''' Execute the command: <code>sudo python main.py</code>
# Display progress bar and time. This function can demonstrate the partial refreshing capability.
+
# The screen displays strings and shapes after whole screen refresh.
 +
# The screen displays images and the time after partial screen refresh. This demonstrates the partial refreshing capability.
 
=== Working with Arduino ===
 
=== Working with Arduino ===
 
==== Hardware connection ====
 
==== Hardware connection ====
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
! e-Paper !! Arduino
+
! e-Paper !! UNO PLUS (3.3V)
 
|-
 
|-
 
| 3.3V || 3V3
 
| 3.3V || 3V3
Line 113: Line 119:
 
| BUSY || D7
 
| BUSY || D7
 
|}
 
|}
 +
 
==== Expected result ====
 
==== 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.
+
# 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.
# Drawing: cycle and line only;
+
# Click the button '''Upload''' to compile and upload the program to your Arduino board.
# String: display characters;
+
# The screen displays strings and shapes after whole screen refresh.
[[File:1.54inch-e-paper-manual-2.png|400px]]
+
# The screen displays images and the time after partial screen refresh. This demonstrates the partial refreshing capability.
 
=== Working with the STM32 development board ===
 
=== Working with the STM32 development board ===
 
Here we use the development board XNUCLEO-F103RB. The Demo is base on the library HAL.
 
Here we use the development board XNUCLEO-F103RB. The Demo is base on the library HAL.
Line 143: Line 150:
 
|}
 
|}
 
==== Expected result ====
 
==== Expected result ====
# Refresh the whole screen
+
# Open the Keil project (MDK-ARM/epd-demo.uvprojx)
# Refresh part of the screen
+
# Click '''Build''' to compile the project.
# Display the Logo of Waveshare
+
# Click '''Download''' to download the program to the target board.
# Draw cycles and lines, display two different sizes of characters
+
# The screen displays strings and shapes after whole screen refresh.
# Display progress bar. This function can demonstrate the partial refreshing capability.
+
# The screen displays images and the time after partial screen refresh. This demonstrates the partial refreshing capability.
 
+
 
== Code analysis ==
 
== 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.  
+
Here, we will analyze the driving code and take the demos for Raspberry Pi based on WiringPi library as examples.  
 +
=== Hardware interface function ===
 +
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.
  
1) Initialization:
+
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.
Reset the screen directly:
+
=== Send Commands and Data (SendCommand and SendData) ===
<pre>
+
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.
EPD_RST_0; // Module reset
+
=== Reset (Reset) ===
driver_delay_xms(100);
+
Module will reset if RST pin is LOW. It is used to restart the module after powered on or awakened. After restarting, you need to initialize module with initialization function (Init) for working properly.
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:
+
=== Initialization (Init) ===
The E-paper screen has two refresh modes, full screen refresh and partial screen refresh.
+
Init has 3 effects: 1, Set the arguments at power up. 2, Awaken the module from deep sleep. 3, Set the mode to Full update or Partial update.
<pre>
+
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.
+
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
Clear the whole screen:  
+
=== Configuration of LUT table(SetLut) ===
 +
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.
 +
=== Set the frame memory (SetFrameMemory) ===
 +
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 action of 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>
 
<pre>
EPD_WriteDispRamMono(xDot, yDot, 0xff);
+
0xC3:8 pixels □□■■■■□□
 +
0x00:8 pixels ■■■■■■■■
 +
0xFF:8 pixels □□□□□□□□
 +
0x66:8 pixels ■□□■■□□■
 
</pre>
 
</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 ==
+
=== Display a Frame (DisplayFrame) ===
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.
+
DisplayFrame is used to display the data from the frame memory.
  
You can select the initialization setting you want by defining corresponding macro.
+
Note:
 +
* 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.
 +
* 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.
  
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.
+
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.
For example
+
=== Private function: Set the memory area (SetMemoryArea) ===
<pre>
+
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.
#define EPD2X9 0
+
=== Private function: Set the memory pointer (SetMemoryPointer) ===
#define EPD02X13 0
+
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.
#define EPD1X54 1
+
=== How to display an image ===  
</pre>
+
There are two ways to display pictures. One is display directly and other is indirectly.
Select the initialization configuration of 1.54 inch screen, and save the modification. Then compile and run the program, it 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.  
+
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)
  
2) Modify the image resolution with the drawing tool in your system.
+
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.
  
Besides the drawing tool in your system, other graphing tools, such as Photoshop, can be used to modify the image resolution.
+
# Open a picture with drawing tool comes with Windows system, create a new image, and set the pixel to 200x200.
 +
# 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 is a monochrome bitmap on examples pack for demonstration (raspberrypi/python/monocolor.bmp).
 +
# Use [[:File:Image2Lcd.7z|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: 200 and 200
 +
#* 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-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]]
 
[[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 ==
 
== Resources ==
 
=== Documentation ===
 
=== Documentation ===
 +
*[https://www.waveshare.com/w/upload/7/7f/1.54inch_e-paper_module_user_manual_en.pdf User Manual]
 +
{{Commom Instruction of SPI e-paper}}
 
* [[:File:1.54inch_e-Paper_Schematic.pdf|Schematic]]
 
* [[:File:1.54inch_e-Paper_Schematic.pdf|Schematic]]
 +
 
=== Demo code ===
 
=== Demo code ===
 
* [[:File:1.54inch_e-Paper_Module_code.7z|Demo code]]
 
* [[:File:1.54inch_e-Paper_Module_code.7z|Demo code]]
 +
*[https://github.com/waveshare/e-Paper Github]
 +
 +
=== Demo video ===
 +
* [https://youtu.be/-XbwDC2AOOw 1.54inch e-paper demo video]
 
=== Datasheets ===
 
=== Datasheets ===
 
* [[:File:1.54inch_e-Paper_Datasheet.pdf|1.54inch_e-Paper_Datasheet.pdf]]
 
* [[: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.13inch_e-Paper_Datasheet.pdf|2.13inch_e-Paper_Datasheet.pdf]]
 
* [[:File:2.9inch_e-Paper_Datasheet.pdf|2.9inch_e-Paper_Datasheet.pdf]]
 
* [[:File:2.9inch_e-Paper_Datasheet.pdf|2.9inch_e-Paper_Datasheet.pdf]]
 +
<!--
 +
===Certification===
 +
*[https://www.waveshare.com/w/upload/e/e2/1.54_e-paper_Certification.rar CE RoHS]
 +
-->
 +
 +
===Related Resources===
 +
This is a post in Arduino Form about our SPI e-Paper thanks to ZinggJM, maybe you want to refer to.
 +
*[https://forum.arduino.cc/index.php?topic=487007.0 Waveshare e-Paper display with SPI]
 +
 +
== FAQ ==
 +
<!--{{e-Paper FAQ}}-->
 +
{{e-Paper FAQ}}
 +
 
==Support==
 
==Support==
 
{{Service00}}
 
{{Service00}}

Revision as of 11:15, 1 April 2019

1.54inch e-Paper
1.54inch-e-Paper-1.jpg

200x200, 1.54inch E-Ink display raw panel
1.54inch e-Paper Module
1.54inch-e-paper-module-6.jpg

200x200, 1.54inch E-Ink display module, SPI interface
{{{name3}}}

{{{name4}}}

{{{name5}}}

Primary Attribute
Category: OLEDs / LCDs, LCD
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
Website
English: Waveshare website
Chinese: 官方中文站点
Onboard Interfaces
SPI
Related Products

Introduction

Note: Please read the user manual before you using the e-paper

200x200, 1.54inch E-Ink display module, SPI interface

More

Video

Resources

Documentation

Demo code

Demo video

Datasheets

Related Resources

This is a post in Arduino Form about our SPI e-Paper thanks to ZinggJM, maybe you want to refer to.

FAQ

Question:
Working requirements of e-Paper?
Answer:
  • Two-color B/W e-paper
    • 【Working】Temperature: 0~50°C; Humidity: 35%~65%RH
    • 【Storage】Temperature: ≤30°C; Humidity: ≤55%RH; Max storage time: 6 months
    • 【Transport】Temperature: -25~70°C; Max transport time: 10 days
    • 【Unpack】Temperature: 20°C±5°C; Humidity: 50%RH±5%RH; Max storage time: Should be assembled in 72h
  • Three-Color e-Paper
    • 【Working】Temperature: 0~40°C; Humidity: 35%~65%RH
    • 【Storage】Temperature: ≤30°C; Humidity: ≤55%RH; Max storage time: 3 months
    • 【Transport】Temperature: -25~60°C; Max transport time: 10 days
    • 【Unpack】Temperature: 20°C±5°C; Humidity: 50%RH±5%RH; Max storage time: Should be assembled in 72h

When store three-color e-Paper, please refresh it to white, and keep the screen upward. Note that you need to update it at least every three months.


Question:
What do you need to note about e-Paper refreshing?
Answer:
  • Refresh mode
    • Full refresh: e-Paper flicker when full refreshing to remove ghost image for best display.
    • Partial refresh: It don't flicker if you use partial refresh (only some of the two-color e-paper support partial refresh). Note that you cannot use Partial refresh all the time, you should full refresh e-paper regularly, otherwise, ghost problem will get worse even damage.
  • Refresh rate
    • When using, you should set the update interval at least 180s.(except Partial supportable types)
    • Please set the e-Paper to sleep mode or power off it directly, otherwise, the e-Paper is damaged because of working in high voltage for long time.
    • You need to update the content of three-color e-Paper at least one time every 24h to avoid from burn-in problem.
  • Working place
  • We recommend you to use the e-Paper indoor. If you need to set the e-paper outdoor, Please place the e-paper in shadow and protect it from UV. When you designed you e-paper product, you should take care about the working situation like temperature, humidity, etc.


Question:
How much could the flexible e-paper be bended
Answer:
  • The IC part of e-Paper cannot be bended, you can bend the display area in degree larger than 60°C


Question:
Why the e-Paper cant work with Arduino?
Answer:

The I/O level of Arduino is 5V, and the e-Paper should be driven with 3V3. If your Arduino cant drive the e-Paper successfully, please try to convert the level to 3.3V

You can also try to connect the Vcc pin to the 5V of Arduino to see whether the e-Paper works, but we recommend you not to use 5V for a long time.


Question:
Why does the color of e-Paper look a little black or grey?
Answer:

You can try to change the value of Vcom on demo codes.


Question:
Three-color e-paper looks more red/yellow than the picture on website?
Answer:

Because of different batch, some of them have aberration. Store the e-Paper right side up will reduce it. And if the e-Paper didn't be refreshed for long time, it will become more and more red/yellow. Please use the demo code to refresh the e-paper for several times in this case.


Question:
Why my e-paper has ghosting problem after working for some days
Answer:

Please set the e-paper to sleep mode or disconnect it if you needn't refresh the e-paper but need to power on your development board or Raspberry Pi for long time.Otherwise, the voltage of panel keeps high and it will damage the panel



Question:
Why the FPC of the e-Paper is broken after using for some times?
Answer:
Please make sure you have used it in correct way.

E-Paper FAQ FPC.jpg



Support

Mail.png Contact your seller (fast response and most recommended)

or send emails to [email protected] (not fast enough but please be patient) for help.

Our working time: 09:00-18:00 (UTC+8 Monday to Saturday)