Difference between revisions of "E-Paper Driver HAT"

From Waveshare Wiki
Jump to: navigation, search
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
{{Infobox item
|brief=Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
 
 
|img=[[File:e-paper-driver-hat-1.jpg|300px|link=http://www.waveshare.com/e-paper-driver-hat.htm]]
 
|img=[[File:e-paper-driver-hat-1.jpg|300px|link=http://www.waveshare.com/e-paper-driver-hat.htm]]
 
|caption=Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
 
|caption=Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
|category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]]
+
|category=[[:Category:Expansions|Expansions]], [[:Category:e-Paper|e-Paper]], [[:Category:Raspberry Pi|Raspberry Pi]]
 
|brand=Waveshare
 
|brand=Waveshare
 
|{{#urlget:amazon|default}}=display
 
|{{#urlget:amazon|default}}=display
Line 13: Line 12:
 
}}
 
}}
 
== Introduction ==
 
== Introduction ==
Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
+
Universal e-Paper Driver HAT, supports various Waveshare SPI interface e-Paper raw panels
  
 
{{Amazon|{{#urlget:amazon|default}}=display
 
{{Amazon|{{#urlget:amazon|default}}=display
 
|More = [http://www.waveshare.com/e-paper-driver-hat.htm More]}}
 
|More = [http://www.waveshare.com/e-paper-driver-hat.htm More]}}
 +
{{Demo video for e-Paper}}
 +
 
== Interfaces ==
 
== Interfaces ==
 
{|class="wikitable"
 
{|class="wikitable"
Line 24: Line 25:
 
| GND || GND
 
| GND || GND
 
|-
 
|-
| DIN || SPI MOSI  
+
| DIN || SPI MOSI pin
 +
|-
 +
| CLK || SPI SCK pin
 +
|-
 +
| CS || SPI chip select (low active)
 +
|-
 +
| DC || Data/Command control pin (high for data, and low for command)
 +
|-
 +
| RST || External reset pin (low active)
 +
|-
 +
| BUSY || Busy state output pin (low active)
 +
|}
 +
 
 +
== Switch settings ==
 +
There are two switches on the front panel of Drive HAT: Display Config and Interface Config.<br />
 +
[[File:e-paper-driver-hat-switch.jpg|400px]]
 +
=== Display Config Switch ===
 +
The Display Config switch on e-Paper Driver HAT is made for being compatible with various SPI interface e-Ink raw panels from Waveshare. This switch has A and B sides. For connecting to different e-Paper raw panels, you can set the Display Config switch refer to the table below:
 +
{|class="wikitable"
 +
|-
 +
! Switch to B !! Switch to A
 +
|-
 +
|[https://www.waveshare.com/1.54inch-e-paper-b.htm 1.54inch e-Paper (B)]||[https://www.waveshare.com/1.54inch-e-paper.htm 1.54inch e-Paper]
 +
|-
 +
|[https://www.waveshare.com/2.13inch-e-paper-b.htm 2.13inch e-Paper (B)]||[https://www.waveshare.com/2.13inch-e-paper.htm 2.13inch e-Paper]
 +
|-
 +
|[https://www.waveshare.com/2.7inch-e-paper.htm 2.7inch e-Paper]||[https://www.waveshare.com/2.9inch-e-paper.htm 2.9inch e-Paper]
 +
|-
 +
|[https://www.waveshare.com/2.7inch-e-paper-b.htm 2.7inch e-Paper (B)]||
 +
|-
 +
|[https://www.waveshare.com/2.9inch-e-paper-b.htm 2.9inch e-Paper (B)]||
 
|-
 
|-
| CLK || SPI SCK
+
|[https://www.waveshare.com/4.2inch-e-paper.htm 4.2inch e-Paper]||
 
|-
 
|-
| CS || SPI chip select (Low active)
+
|[https://www.waveshare.com/4.2inch-e-paper-b.htm 4.2inch e-Paper (B)]||
 
|-
 
|-
| DC || Data/Command control pin (High for data, and low for command)
+
|[https://www.waveshare.com/7.5inch-e-paper.htm 7.5inch e-Paper]||
 
|-
 
|-
| RST || External reset pin (Low for reset)
+
|[https://www.waveshare.com/7.5inch-e-paper-b.htm 7.5inch e-Paper (B)]||
 +
|}
 +
 
 +
=== Interface Config Switch ===
 +
With Interface Config, you can change the SPI interface of e-Paper to 3-lin SPI or 4-line SPI
 +
{|class="wikitable"
 
|-
 
|-
| BUSY || Busy state output pin (Low for busy)
+
! Switch to 0 !! Switch to 1
 +
|-
 +
|4-line SPI || 3-line SPI
 
|}
 
|}
== Working principle ==
+
Note: Examples we provide use 4-line SPI by default
=== 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.  
+
=== Example for 7.5inch e-Paper Switch Settings ===
=== Communication protocol ===
+
Connecting the e-Paper Driver HAT to 7.5inch e-Paper, we must switch the Display Config to B according to the Display Config table above, and set the Interface Config to 0 to make the e-Paper work on 4-line SPI mode.<br>
[[File:1.54inch-e-paper-manual-1.png|400px|thumb|SPI timing]]
+
[[File:e-paper-driver-hat-switch-example.jpg|600px]]
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 ==
 
== How to use ==
 
=== Working with Raspberry Pi ===
 
=== Working with Raspberry Pi ===
 
==== Installing libraries required ====
 
==== Installing libraries required ====
If you want to connect your E-paper screen to Raspberry Pi, you should install some necessary libraries, or else the [[:File:e-paper-driver-hat-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]].
+
If you want to connect your E-paper screen to Raspberry Pi, you should install some necessary libraries, or else the Demo 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]], where you can find the detailed presentation about the installations of libraries wiringPi, bcm2835 and python.
  
You can find the detailed presentation about the installations of libraries wiringPi, bcm2835 and python.
 
 
==== Hardware connection ====
 
==== Hardware connection ====
Here is the connection between Raspberry Pi 3B and E-paper.
+
Here is the connection between Raspberry Pi 3B and E-paper (BCM).
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
Line 80: Line 107:
 
| BUSY || 24 (BCM)
 
| BUSY || 24 (BCM)
 
|}
 
|}
 +
 
==== Expected result ====
 
==== Expected result ====
 
1) After the corresponding libraries installed, 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.
Line 86: Line 114:
 
* '''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 (about 6s), 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. Please be patient.
 +
 
 
=== Working with Arduino ===
 
=== Working with Arduino ===
 
==== Hardware connection ====
 
==== Hardware connection ====
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
! e-Paper !! Arduino
+
! e-Paper !! Arduino UNO
 
|-
 
|-
| 3.3V || 3V3 (if the display doesn't work on 3.3V, you can try 5V in most cases.)
+
| 3.3V || 3V3  
 
|-
 
|-
 
| GND || GND
 
| GND || GND
Line 109: Line 138:
 
| 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
Line 116: Line 146:
 
* 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. 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 or NUCLEO-F103RB. (The demo code of 1.54inch/2.13inch/2.9inch e-Paper are based on NUCLEO-F103RB,
* The demo code is based on HAL, so you can port the demo code to other STM board with STM32CubeMX.
+
Others are based on STM32F103ZE)
 +
 
 +
* The demo code is based on HAL, so you can port the demo code to other STM boards with STM32CubeMX.
 
* The demo code can be compiled successfully in Keil v5
 
* The demo code can be compiled successfully in Keil v5
 
==== Hardware connection ====
 
==== Hardware connection ====
Line 140: Line 172:
 
|-
 
|-
 
| BUSY || PA3
 
| BUSY || PA3
 +
|}
 +
 +
Connecting to the NUCLEO-F103RB:
 +
{|class="wikitable"
 +
|-
 +
! e-Paper !! NUCLEO-F103RB
 +
|-
 +
| 3.3V || 3V3
 +
|-
 +
| GND || GND
 +
|-
 +
| DIN || PA7
 +
|-
 +
| CLK || PA5
 +
|-
 +
| CS || PB6
 +
|-
 +
| DC || PC7
 +
|-
 +
| RST || PA9
 +
|-
 +
| BUSY || PA8
 
|}
 
|}
  
Line 152: Line 206:
 
=== Documentation ===
 
=== Documentation ===
 
* [[:File:E-Paper-Driver-HAT-Schematic.pdf|Schematic]]
 
* [[:File:E-Paper-Driver-HAT-Schematic.pdf|Schematic]]
 +
===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]
 +
*[https://github.com/PiSugar/pisugar-case-pihat-cap Pisugar case]
  
=== Demo code ===
+
=== e-Paper ===
* [[:File:e-paper-driver-hat-code.7z|Demo code]]
+
*[[1.54inch e-Paper Module | 1.54inch e-Paper]]
=== Datasheets ===
+
*[[1.54inch e-Paper Module (B) | 1.54inch e-Paper (B)]]
* [[:File:7.5inch-e-paper-specification.pdf|Datasheet]]
+
*[[2.13inch e-Paper HAT | 2.13inch e-Paper]]
 +
*[[2.13inch e-Paper HAT (B) | 2.13inch e-Paper (B)]]
 +
*[[2.7inch e-Paper HAT | 2.7inch e-Paper]]
 +
*[[2.7inch e-Paper HAT (B) | 2.7inch e-Paper]]
 +
*[[2.9inch e-Paper Module | 2.9inch e-Paper]]
 +
*[[2.9inch e-Paper Module (B) | 2.9inch e-Paper (B)]]
 +
*[[4.2inch e-Paper Module | 4.2inch e-Paper]]
 +
*[[4.2inch e-Paper Module (B) | 4.2inch e-Paper (B)]]
 +
*[[7.5inch e-Paper HAT | 7.5inch e-Paper]]
 +
*[[7.5inch e-Paper HAT (B) | 7.5inch e-Paper (B)]]
 +
 
 +
== FAQ ==
 +
<!--{{e-Paper FAQ}}-->
 +
{{e-Paper FAQ}}
  
 
==Support==
 
==Support==
 
{{Service00}}
 
{{Service00}}
 +
 +
[[Category:Expansions|Expansions]] [[Category:e-Paper|e-Paper]] [[Category:Raspberry Pi|Raspberry Pi]]

Revision as of 09:06, 17 July 2019

E-Paper Driver HAT
E-paper-driver-hat-1.jpg

Universal e-Paper Driver HAT, supports various Waveshare SPI e-Paper raw panels
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

Universal e-Paper Driver HAT, supports various Waveshare SPI interface e-Paper raw panels

More

Video

Interfaces

VCC 3.3V
GND GND
DIN SPI MOSI pin
CLK SPI SCK pin
CS SPI chip select (low active)
DC Data/Command control pin (high for data, and low for command)
RST External reset pin (low active)
BUSY Busy state output pin (low active)

Switch settings

There are two switches on the front panel of Drive HAT: Display Config and Interface Config.
E-paper-driver-hat-switch.jpg

Display Config Switch

The Display Config switch on e-Paper Driver HAT is made for being compatible with various SPI interface e-Ink raw panels from Waveshare. This switch has A and B sides. For connecting to different e-Paper raw panels, you can set the Display Config switch refer to the table below:

Switch to B Switch to A
1.54inch e-Paper (B) 1.54inch e-Paper
2.13inch e-Paper (B) 2.13inch e-Paper
2.7inch e-Paper 2.9inch e-Paper
2.7inch e-Paper (B)
2.9inch e-Paper (B)
4.2inch e-Paper
4.2inch e-Paper (B)
7.5inch e-Paper
7.5inch e-Paper (B)

Interface Config Switch

With Interface Config, you can change the SPI interface of e-Paper to 3-lin SPI or 4-line SPI

Switch to 0 Switch to 1
4-line SPI 3-line SPI

Note: Examples we provide use 4-line SPI by default

Example for 7.5inch e-Paper Switch Settings

Connecting the e-Paper Driver HAT to 7.5inch e-Paper, we must switch the Display Config to B according to the Display Config table above, and set the Interface Config to 0 to make the e-Paper work on 4-line SPI mode.
E-paper-driver-hat-switch-example.jpg

How to use

Working with Raspberry Pi

Installing libraries required

If you want to connect your E-paper screen to Raspberry Pi, you should install some necessary libraries, or else the Demo below may work improperly. For more information about how to install the Raspberry Pi libraries, please visit the website: Libraries Installation for RPi, where you can find the detailed presentation about the installations of libraries wiringPi, bcm2835 and python.

Hardware connection

Here is the connection between Raspberry Pi 3B and E-paper (BCM).

e-Paper Raspberry Pi 3B
3.3V 3.3V
GND GND
DIN MOSI
CLK SCLK
CS CE0
DC 25 (BCM)
RST 17 (BCM)
BUSY 24 (BCM)

Expected result

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: make, to compile the code and generate a file epd. Execute the command: sudo ./epd, the program will run.
  • WringPi: Execute the command: make, to compile the code and generate a file epd. Execute the command: sudo ./epd, the program will run.
  • Python: Execute the command: sudo python main.py

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.

Working with Arduino

Hardware connection

e-Paper Arduino UNO
3.3V 3V3
GND GND
DIN D11
CLK D13
CS D10
DC D9
RST D8
BUSY D7

Expected result

  1. 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
  2. Upload the project.
  3. E-paper will display the image.

Note:

  • The refresh rate of this module is slow, and it will flicker for several times during refreshing. Please be patient.

Working with the STM32 development board

  • Here we use STM32F103ZE development board or NUCLEO-F103RB. (The demo code of 1.54inch/2.13inch/2.9inch e-Paper are based on NUCLEO-F103RB,

Others are based on STM32F103ZE)

  • The demo code is based on HAL, so you can port the demo code to other STM boards with STM32CubeMX.
  • The demo code can be compiled successfully in Keil v5

Hardware connection

Connecting to the STM32F103ZE:

e-Paper STM32F103ZE
3.3V 3V3
GND GND
DIN PA7 (MOSI)
CLK PA5 (SCK)
CS PA4
DC PA2
RST PA1
BUSY PA3

Connecting to the NUCLEO-F103RB:

e-Paper NUCLEO-F103RB
3.3V 3V3
GND GND
DIN PA7
CLK PA5
CS PB6
DC PC7
RST PA9
BUSY PA8

Expected result

  1. Open the project (epd-demo.uvprojx), which is under the MDK-ARM directory.
  2. Click Build to compile the project.
  3. Click Download to load the code to your board.
  • 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.

Resources

Documentation

Related Resources

e-Paper

FAQ

 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.


Support

Support

If you require technical support, please go to the Support page and open a ticket.