Difference between revisions of "2.9inch e-Paper Module (B)"

From Waveshare Wiki
Jump to: navigation, search
(Demo code)
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
{{Infobox item
|brief=296x128, 2.9inch E-Ink display module, three-color
+
|name=2.9inch e-Paper (B)
|img=[[File:2.9inch-e-paper-module-b-4.jpg|300px|link=http://www.waveshare.com/2.9inch-e-paper-module-b.htm]]
+
|name2=2.9inch e-Paper Module (B)
|caption=296x128, 2.9inch E-Ink display module, three-color, SPI interface
+
|img=[[File:2.9inch-e-Paper-B-1.jpg|300px|link=https://www.waveshare.com/2.9inch-e-Paper-B.htm]]
 +
|img2=[[File:2.9inch-e-paper-module-b-4.jpg|300px|link=http://www.waveshare.com/2.9inch-e-paper-module-b.htm]]
 +
|caption=296x128, 2.9inch E-Ink display raw panel
 +
|caption2=296x128, 2.9inch E-Ink display module, three-color, 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}}
 +
 
296x128, 2.9inch E-Ink display module, three-color, SPI interface
 
296x128, 2.9inch E-Ink display module, three-color, SPI interface
  
 
{{Amazon|{{#urlget:amazon|default}}=display
 
{{Amazon|{{#urlget:amazon|default}}=display
 
|More = [http://www.waveshare.com/product/2.9inch-e-paper-module-b.htm More]}}
 
|More = [http://www.waveshare.com/product/2.9inch-e-paper-module-b.htm More]}}
 +
<!--
 
== Interfaces ==
 
== Interfaces ==
 
{|class="wikitable"
 
{|class="wikitable"
Line 74: Line 80:
 
| CS || CE0
 
| CS || CE0
 
|-
 
|-
| DC || 25
+
| DC || Pin22/GPIO25
 
|-
 
|-
| RST || 17
+
| RST || Pin11/GPIO17
 
|-
 
|-
| BUSY || 24
+
| BUSY || Pin18/GPIO24
 
|}
 
|}
 +
 
==== Expected result ====
 
==== Expected result ====
1) After installed the corresponding libraries, you can copy the relative programs into your Raspberry Pi, and then enter the corresponding file.
+
1) After the corresponding libraries installed, 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.  
 
* '''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.  
 
* '''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>
 
* '''Python:''' Execute the command: <code>sudo python main.py</code>
 
2) Image will be displayed on the screen.
 
2) Image will be displayed on the screen.
* Note:The refresh rate of this module is slow, and it will flicker for several times during refreshing. Please be patient.
+
* Note:The refresh rate of this module is slow, and it will flicker for several times during refreshing (about 15s). Please be patient.
 
=== 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 109: Line 116:
 
| BUSY || D7
 
| BUSY || D7
 
|}
 
|}
 +
 
==== Expected result ====
 
==== Expected result ====
# Copy the libraries file of Arduino demo code to the libraries folder which is under the installation directory of Arduino IDE, it usually is C:\users\username\documents\arduino\libraries. You can also designate the location on Arduino IDE--> File -->Preferences -->Sketchbook location
+
# Copy the libraries file of Arduino demo code to the libraries folder which is under the installation directory of Arduino IDE, it usually is C:\users\username\documents\arduino\libraries. You can also designate the location on Arduino IDE-> File ->Preferences ->Sketchbook location
 
# Upload the project.
 
# Upload the project.
 
# E-paper will display the image.
 
# E-paper will display the image.
 
Note:
 
Note:
* The refresh rate of this module is slow, and it will flicker for several times during refreshing. Please be patient.
+
* The refresh rate of this module is slow, and it will flicker for several times during refreshing (about 15s). Please be patient.
 
=== Working with the STM32 development board ===
 
=== Working with the STM32 development board ===
 
* Here we use STM32F103ZE development board.
 
* Here we use STM32F103ZE development board.
Line 123: Line 131:
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
! e-Paper !! XNUCLEO-F103RB
+
! e-Paper !! STM32F103ZE
 
|-
 
|-
 
| 3.3V || 3V3
 
| 3.3V || 3V3
Line 129: Line 137:
 
| GND || GND
 
| GND || GND
 
|-
 
|-
| DIN || PA7
+
| DIN || PA7 (MOSI)
 
|-
 
|-
| CLK || PA5
+
| CLK || PA5 (SCK)
 
|-
 
|-
| CS || PB6
+
| CS || PA4
 
|-
 
|-
| DC || PC7
+
| DC || PA2
 
|-
 
|-
| RST || PA9
+
| RST || PA1
 
|-
 
|-
| BUSY || PA8
+
| BUSY || PA3
 
|}
 
|}
 +
 
==== Expected result ====
 
==== Expected result ====
 
# Open the project (epd-demo.uvprojx), which is under the MDK-ARM directory.
 
# Open the project (epd-demo.uvprojx), which is under the MDK-ARM directory.
Line 146: Line 155:
 
# Click Download to load the code to your board.
 
# Click Download to load the code to your board.
 
* Reset, the screen will display image.
 
* Reset, the screen will display image.
*: Note: The refresh rate of this module is slow, and it will flicker for several times during refreshing. Please be patient.
+
*: Note: The refresh rate of this module is slow, and it will flicker for several times during refreshing (about 15s). Please be patient.
 
== Code analysis ==
 
== Code analysis ==
Here, we will analyze the driving code (epd2in7b.h, epd2in7b.c or epd2in7b.cpp). Taking the demo of Raspberry Pi based on WiringPi library as examples.  
+
Here, we will analyze the driving code and take the demos for Raspberry Pi based on WiringPi library as examples.  
 
=== Hardware interface function ===
 
=== 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.
 
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.
Line 156: Line 165:
 
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.
 
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.
 
=== Reset (Reset) ===
 
=== 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.
+
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.
 +
 
 
=== Initialization (Init) ===
 
=== Initialization (Init) ===
After powering on the module, initialization function (Init) will configure the parameters of module. It can also wake up module from sleep mode. Process of initialization: reset --> booster soft start --> power on --> panel setting --> VCOM and data interval setting --> resolution setting --> VCM DC setting.
+
After powering on the module, initialization function (Init) will configure the parameters of module. It can also wake up module from sleep mode. Process of initialization: reset -> booster soft start -> power on -> panel setting -> VCOM and data interval setting -> resolution setting -> VCM DC setting.
  
 
For detailed explanation of commands, please refer to [[File:2.9inch-e-paper-b-specification.pdf]]
 
For detailed explanation of commands, please refer to [[File:2.9inch-e-paper-b-specification.pdf]]
Line 164: Line 174:
 
DisplayFrame is used to send a frame to module, and the screen will refresh and display it.
 
DisplayFrame is used to send a frame to module, and the screen will refresh and display it.
  
Process: Send command data start transmission 1 --> Send data of dark area --> Send command data start transmission 2 --> Send data of red area --> Refresh the screen.
+
Process: Send command data start transmission 1 -> Send data of dark area -> Send command data start transmission 2 -> Send data of red area -> Refresh the screen.
 
Note:
 
Note:
 
* One frame consist of images of black area and red area, so we need to send two images for displaying one frame,
 
* One frame consist of images of black area and red area, so we need to send two images for displaying one frame,
* 1 byte = 8 pixels, doesn’t support Gray scale (Can only display black and white). A bit set stands for black/red pixel, otherwise a bit reset stands for white.
+
* 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 black/red.
  
 
For example:
 
For example:
Line 177: Line 187:
 
</pre>
 
</pre>
 
* This module doesn’t support partial refresh.
 
* This module doesn’t support partial refresh.
* The refresh rate of this module is slow, and it will flicker for several times during refreshing. Please be patient.
+
* The refresh rate of this module is slow, and it will flicker for several times during refreshing (about 15s). Please be patient.
 
=== Sleep mode (Sleep) ===
 
=== Sleep mode (Sleep) ===
 
Sleep can make the module go into sleep mode to reduce the consumption.
 
Sleep can make the module go into sleep mode to reduce the consumption.
  
Process: VCM DC setting --> power setting --> power off
+
Process: VCM DC setting -> power setting -> power off
  
 
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.
 
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.
Line 192: Line 202:
  
 
# Open a picture with drawing tool comes with Windows system, create a new image, and set the pixel to 128x296.
 
# 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.
+
# 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).
 
#: 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:
+
# 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
 
#* Output data type: C language array
 
#* Scanning mode: vertical scanning
 
#* Scanning mode: vertical scanning
Line 202: Line 212:
 
#* Inverse color: Check (Check: the white on image will be inversed to 1, and black is inversed to 0)
 
#* Inverse color: Check (Check: the white on image will be inversed to 1, and black is inversed to 0)
 
# Click “Save”, to generate .c file. Copy the corresponding array into your project, and you can display picture by calling this array.
 
# Click “Save”, to generate .c file. Copy the corresponding array into your project, and you can display picture by calling this array.
 +
-->
  
 
== Resources ==
 
== Resources ==
 
=== Documentation ===
 
=== Documentation ===
* [[:File:2.9inch_e-Paper_module_b_Schematic.pdf|Schematic]]
+
*[https://www.waveshare.com/w/upload/5/55/2.9inch-e-paper-module-b-user-manual-en.pdf User Manual]
 +
{{Commom Instruction of SPI e-paper}}
 +
* [[:File:2.9inch_e-Paper_Schematic.pdf|Schematic]]
 +
 
 
=== Demo code ===
 
=== Demo code ===
 
* [[:File:2.9inch_e-paper_module_b_code.7z|Demo code]]
 
* [[:File:2.9inch_e-paper_module_b_code.7z|Demo code]]
 +
*[https://github.com/waveshare/e-Paper Github]
 +
 
=== Datasheets ===
 
=== Datasheets ===
 
* [[:File:2.9inch-e-paper-b-specification.pdf|Datasheets]]
 
* [[:File:2.9inch-e-paper-b-specification.pdf|Datasheets]]
 +
===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 02:14, 26 March 2019

2.9inch e-Paper (B)
2.9inch-e-Paper-B-1.jpg

296x128, 2.9inch E-Ink display raw panel
2.9inch e-Paper Module (B)
2.9inch-e-paper-module-b-4.jpg

296x128, 2.9inch E-Ink display module, three-color, 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: The raw panel require a driver board, If you are the first time use this e-Paper, we recommend you to buy the HAT version or buy more one driver hat for easy use, otherwise you need to make the driver board yourself. And this instruction is based on the version with PCB or driver board.

296x128, 2.9inch E-Ink display module, three-color, SPI interface

More

Resources

Documentation

Demo code

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)