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

From Waveshare Wiki
Jump to: navigation, search
(Created page with "{{infobox item| |img=link=https://www.waveshare.com/12.48inch-e-paper-module.htm |category=e-Paper |brand=W...")
(No difference)

Revision as of 09:45, 8 November 2019

12.48inch e-Paper Module
12.48inch e-Paper-Module-1.jpg
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Primary Attribute
Category: e-Paper
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
Website
English: {{{website_en}}}
Chinese: 中文官网
Onboard Interfaces
Related Products

特点

  • 尺寸: 12.48inch
  • 外形尺寸(裸屏):261.5mm × 211mm × 0.3mm
  • 外形尺寸(亚克力外壳):280mm x 229.5mm
  • 显示尺寸:252.976mm × 190.896mm
  • 工作电压:3.3V/5V
  • 通信接口:SPI
  • 点距:0.194mm × 0.194mm
  • 分辨率:1304 x 984
  • 显示颜色:黑、白
  • 灰度等级:2
  • 全局刷新 :8s
  • 刷新功耗 : 26.4mW(typ.)
  • 待机功耗 :<=0.017mW

【备注】: 刷新时间:刷新时间为实验测试数据,实际刷新时间会有误差,以实际效果为准。全局刷新过程中会有闪烁效果,这个是正常现象
功耗:功耗数据为实验测试数据,实际功耗由于驱动板的存在和实际使用情况的不同,会有一定误差,以实际效果为准

SPI 通信时序

700px
由于墨水屏只需要显示,这里将从机发,主机收的数据线(MISO)隐藏。
CS:从机片选,当CS为低电平的时候,芯片使能
DC:数据/命令控制引脚,当DC=0时写入命令;DC=1时写入数据
SCLK: SPI通信时钟
SDIN:SPI通信主机发送,从机接收
时序:CPHL=0, CPOL=0 (SPI0)
【备注】具体关于SPI通信的相关信息,可以自行网上搜索资料了解

屏幕图片刷新实质

上面了解到屏幕使用的是SPI通信,对于此屏幕可能有些客户会觉得奇怪为什么会有两个排线?
对于此问题的解释就是该屏幕是由4块小屏幕拼接而成变得大尺寸屏幕,因此对应着4路片选信号。

  • 刷新实质

简略图如下:
12.48inch e-paper-4part.png
我们把四部分分别命名为S2,M2,M1,S1,他们在程序中是依次进行传输的。
其中S2,M1是同样大小的分辨率:648*492,M2,S1是同样大小的分辨率:656*492.
他们的横竖加起来分辨率就是:1304*984

  • 控制原理

4个屏幕,那么他们就对应这4个SPI从机,所需要的控制线就是4个屏幕的总数:
一般SPI接口类显示屏具有以下4条控制线:MOSI,SCLK,CS,DC
然后需要最基本电源和复位:VCC,GND,RST
由于墨水屏的刷新特性,会一直闪烁,用于表示屏幕忙碌:BUSY
为了节省接口,其中4块屏幕共用VCC,GND,MOSI,SCLK;2块屏幕共用DC,RST
此时,重点来了,4块屏幕所需要电源线加控制线16条:
12.48inch e-paper-4part2.png

  • 核心代码分析

屏幕要进行工作,一般都会进行复位并初始化一些相关的寄存器,然后传输图像数据,最后打开显示。
这里主要讲述传输图像数据:
对于黑白或者红白,我们都可以认为是一张二阶灰度图片,那么一个字节的8个位就对应8个像素点,那么S2部分和M1部分:一行像素点有648点,将占用648/8 = 81个字节,有492列,总共占用81 * 492 = 39852个字节。同理M2部分与S1部分:一行像素点有656点,将占用656/8 = 82个字节,有492列,总共占用82 * 492 = 40344个字节。
12.48inch e-paper的寄存器0x13和0x10分别用于控制黑色图片数据和红色图片数据的传输,下面以黑白屏为例子:

void EPD_12in48_Display(const UBYTE *Image)
{
    int x,y;
    //S1 part 648*492
    EPD_S2_SendCommand(0x13);
    for(y = 0; y < 492; y++)
        for(x = 0; x < 81; x++) {
            EPD_S2_SendData(*(Image + (y*163 + x)));
        }

    //M2 part 656*492
    EPD_M2_SendCommand(0x13);
    for(y = 0; y < 492; y++)
        for(x = 81; x < 163; x++) {
            EPD_M2_SendData(*(Image+ (y*163) +x));
        }

    //S1 part 656*492
    EPD_S1_SendCommand(0x13);
    for(y = 492; y < 984; y++)
        for(x = 81; x < 163; x++) {
            EPD_S1_SendData(*(Image+ (y*163) +x));
        }

    //M1 part 648*492
    EPD_M1_SendCommand(0x13);
    for(y = 492; y < 984; y++)
        for(x = 0; x < 81; x++) {
            EPD_M1_SendData(*(Image+ (y*163) +x));
        }
        
    EPD_12in48_TurnOnDisplay();
}


We provide demo codes for four popular hardware platforms, Raspberry Pi, Arduino UNO, STM32 and the ESP32. The product you receive may be pre-assembled, you need to remove the back panel and connect your device like Raspberry Pi.

Raspberry Pi

Hardware connection

12in48-epaper-RPIconnet.JPG

The pins used can be found on schematic according to codes

12in48-epaper-rpi1.png

Enable SPI interface

Open terminal and type command

sudo raspi-config

Choose Interfacing Options -> SPI -> Yes. Then reboot the Raspberry Pi

sudo reboot

Libraries installation

  • Install BCM2835
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz 
cd bcm2835-1.60/
sudo ./configure
sudo make
sudo make check
sudo make install
  • Install wiringPi
sudo apt-get install wiringpi
cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
  • Install python2
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-pil
sudo pip install RPi.GPIO
sudo pip install spidev
  • Install python3
sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo pip3 install RPi.GPIO
sudo pip3 install spidev

Download

Open terminal and run commands to download codes

sudo apt-get install p7zip-full
wget http://www.waveshare.net/w/upload/9/9a/12.48inch_e-Paper_Module_Code_RPI.7z
7z x 12.48inch_e-Paper_Module_Code_RPI.7z  -r -o./12.48inch_e-Paper_Module_Code
sudo chmod 777 -R 12.48inch_e-Paper_Module_Code
cd 12.48inch_e-Paper_Module_Code

Run codes

  • C codes
cd c
sudo nano examples/main.c
Confirm that which kind of 12.48inch e-Paper do you use. If you use the two-color display, modify the file as below
12in48-epaper-rpi-c1.png
If you use the tree-color display, modify the file as below
12in48-epaper-rpi-c2.png
Save then compile and run the code
sudo make clean
sudo make
sudo ./epd
  • Python codes
Open terminal and run the demo codes by commands:
cd python/examples
For two-color version
sudo python epd_12in48_test.py
For three-color version
sudo python epd_12in48_test.py
  • Python codes-Weather
cd python/examples
For two-color display
sudo python Show_EN_Weather.py
For three-color display
sudo python Show_EN_Weather.py B
For help information
sudo python Show_EN_Weather.py help
12in48-epaper-rpi-weather1.jpg12in48-epaper-rpi-weather2.jpg

Arduino

Hardware connection

You can directly insert the Arduino UNO to PCB

12in48-epaper-Arduinoconne.JPG

About the pins used:

12in48-epaper-arduino1.png

Run codes

Download demo codes from wiki and unzio it.
Copy the 12in48 folder to the libraries directory which is under the installation directory of Arduino IDE.(The installation directory generally is C:\Program Files (x86)\Arduino\libraries)
Open Ardunin IDE software, choose Tool->Board->Arduino UNO:
12in48-epaper-arduino2.png
Click File -> Examples -> EPD12in48 to opem demo cods
12in48-epaper-arduino3.png
If your e-Paper is two-color version, use the epd12in48-demo, otherwise, use the epd12in48b-demo
Compile and download the codes to board

STM32

The development board we use is Waveshare Open103Z. The project is developed based on STM32 HAL libraries.

Hardware connection

To assemble the Open32, you should connect it by wires provided.

12in48-epaper-STM32connet.jpg

About the pins used, you can refer to e-paper.ioc file.

12in48-epaper-STM32-5.png
12in48-epaper-STM32-6.png

Run codes

Open the project (~\STM32\NUCLEO-F103RB\MDK-ARM\e-paper.uvprojx), compile and download to developmen board. It requires about 10s for the two-color version and 20s for three-color display.

ESP32

The demo codes for ESP32 are developed with Arduino IDE as well.

Software setup

To develop ESP32, you should first set up the environment.

12in48-epaper-esp32-1.png
  • Enter the tools folder, and run the get.exe file as administrator. After installing, Copy the esp32-epd-12in48 folder of ESP32 demo codes to [Arduino IDE installation directory]/Hardware/espressif/esp32/libraries
12in48-epaper-esp32-2.png

Hardware connection

Here we use Waveshare e-Paper ESP32 Driver Board as an example. Attach it on PCB.

12in48-epaper-esp32connet.JPG

About the pins used, you can refer to schematic and codes

12in48-epaper-esp32-connet1.png

Examples 1

Open Arduino IDE software, and find the examples on File->Examples

12in48-epaper-esp32-3.png

If you use two-color e-Paper, choose the epd12in48-demo, otherwise, use the epd12in48B-demo

WiFi example

As we know, ESP32 features WIFI, you can set it as master or slave. Here we provide demo codes that control the e-Paper on the web by WIFI.

  • You need to first modify the wifi connection information. Open the Web_App.cpp file and modify the line 50 and line 51:

12in48-epaper-esp32-4.png

  • Open wifi.ino file, compile and download it to your ESP32 board. Open Serial monitor to query the IP address
12in48-epaper-esp32-5.png
  • Open the Chrome browser, and enter the web with the IP address
12in48-epaper-esp32-html0.png
  • Select the display type, here we take 12.48inch e-Paper (two-color version) as example:
Click 12.48 e-Paper, and there are six functions provided. You can use them to draw points, lines and so on. On the top of the webpage, the type of e-Paper and display color are shown.
12in48-epaper-esp32-html1.png
  • The corresponding coordination of display is as below.
12in48-epaper-esp32-html2.png
  1. Draw points
    Click Draw point then you will get the window as below.
    12in48-epaper-esp32-html3.png
  2. Draw lines
    Click Draw Line, you will get the window as below
    12in48-epaper-esp32-html4.png
  3. Draw Rectangle
    Click Draw Rectangle, you will get the window as below
    12in48-epaper-esp32-html5.png
  4. Draw circle
    Click Draw Circle, you will get the window as below
    12in48-epaper-esp32-html6.png
  5. Draw String
    Click Draw String, you will get the windows as below
    12in48-epaper-esp32-html7.png
  6. Display picture
    Click Show picture, you will get the window like below. Click upload image to choose a picture.
    12in48-epaper-esp32-html8.png
    Draw the page to bottom to check the original picture.
    12in48-epaper-esp32-html9.png
    Select a process algorithm, for two-color display, only the mono methods work.
    12in48-epaper-esp32-html10.png
    12in48-epaper-esp32-html11.png
  7. Finally, click the upload image button on left to upload image to e-Paper for displaying.
    12in48-epaper-esp32-html12.png
You can open the Serial monitor of IDE to check the debug information
12in48-epaper-esp32-html13.png
You can also press F12 button to open the debug console of browser
12in48-epaper-esp32-html14.png

文档

程序

数据手册

开发资料

Template:Two-color e-paper 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


Supports

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)