搜索
Search
回康医疗
jiajie Where are you now:
Homepage
/
/
Get your hands on a E-paper display from scratch-Learn to play it

Get your hands on a E-paper display from scratch-Learn to play it

(Summary description)

Get your hands on a E-paper display from scratch-Learn to play it

(Summary description)

Information

Get your hands on a E-paper display from scratch-Learn to play it-01

 

Hello you guys! Recently our newly-teamed up ShiningMan has been working on a teaching project to walk you through the process of how to play E-paper display from scratch!

Let's jump right into the main body of this 1st post!!!

 

First of all, you have to know what E-paper display is

1. Basic Principle

The technology behind e-paper is a "microcapsule electrophoretic display" technology.

The basic principle is that charged nanoparticles suspended in a liquid migrate under the action of an electric field. Electronic ink is coated on a layer of plastic

film, and then coated with a thin film transistor (TFT) circuit, which is controlled by a driver IC to form a pixel pattern.

 

1)Monochrome E-paper display

Electronic ink is made up of millions of microcapsules, which are about the diameter of a human hair. Each microcapsule contains electrophoretic particles

-- negatively charged white and positively charged black particles -- suspended in a clear liquid.

Using the principle of positive and negative attraction, when the electric field is turned on, the black or white particles corresponding to the block will

move to the top of the microcapsule, and the user can see white or black on the block.

   

2)Tri-color E-paper display

Three-color electronic ink system, especially suitable for electronic shelf label (ESL) applications.

The operating principle of the three-color electronic ink system is similar to that of the two-color system.

Different voltages are applied to make particles of different colors move to the upper layer, and different colors are seen.

The three-color system is developed under the framework of microcup technology.

 

 

3)E-paper Structure

1) E-paper diaphragm

This is the core material of the electronic paper display module, which is responsible for displaying the patterns that the human eye actually sees.

2) Bottom plate

As the pixel electrode (lower electrode) of the electronic paper display, it is used to control the black and white change of each pixel of the electronic paper.

There are many types of base plates to choose from, including PCB, FPC, TFT glass, PET, etc.

In actual application, different bottom plates can be selected according to specific needs. The electronic paper diaphragm can be attached to the base plate by lamination.

3) Driver chip

The corresponding logic level and timing can be generated according to the control instructions and signals, which are used to control the working timing and state

of each pixel (or segment code) on the backplane, and enable the electronic paper to display the desired pattern.

4) Transparent protective film

A polymer plastic film with strong water vapor permeability. Using a laminator to tightly attach it to the e-paper diaphragm and the bottom plate can effectively

prevent water vapor from invading the e-paper diaphragm and avoid damage to the e-paper due to moisture.

5) Edge glue

A special chemical glue, which is evenly applied on the surrounding edges of the transparent protective film, plays the role of isolating water vapor.

It can prevent water vapor from seeping in from around the transparent protective film and causing damage to the electronic paper diaphragm.

 

2. Next, getting your development board ready(For starters we highly recommend demo kits from Good Display)

STM32、ESP8266、ESP32、ArduinoUNO https://www.good-display.cn/product/71/

We will consider wiring first, here a diagram taken STM32 for e.g.

This is how I connected, VCC power supply and GND grounding are fixed, others can be freely defined according to the usage,

as long as the program is defined according to your definition, there is no problem.

 

3. The key point is to understand why these pins are connected? What do they each represent?

a. First of all, there is no need for much power and grounding. The MCU must have a power supply to work.

b. We need to be clear that the electronic paper and any master control use the SPI communication protocol (the parallel port screen is not discussed here)

DIN represents MOSI (master device (single-chip microcomputer) output, slave device (electronic paper) input, this is easy to understand,

the single-chip microcomputer needs to send content display to electronic paper)

CLK represents the clock (both parties of data transmission must agree to carry out on the same frequency band)

c. CS stands for chip select, active low

d. DC is a data pin, representing data/command read and write selection, high level is data, low level is command

e. RST is the reset pin of the e-paper. You can understand that when the e-paper re-updates the screen, it needs to be powered off to take a breath before continuing.

f. BUSY, as the name implies, is busy, and it is used to detect whether the electronic paper is busy or idle. If it is in the busy state, the MCU cannot perform any operations on the electronic paper.

 

Now for the code:

1. You need to embody the wiring in the code

void EPD_GPIO_Init(void)

{

GPIO_InitTypeDef GPIO_InitStructure;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOE, ENABLE);

//CS-->PD8 SCK-->PD9 SDO--->PD10

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10; //Port con

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

GPIO_Init(GPIOD, &GPIO_InitStructure);

// D/C--->PE15 RES-->PE14

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14|GPIO_Pin_15; //Port configuration

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

GPIO_Init(GPIOE, &GPIO_InitStructure);

// BUSY--->PE13

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;

 

2. Get code for each hardware inteface

a. SPI

SPI timing diagram

void SPI_Write(unsigned char value)

{

unsigned char i;

for(i=0; i<8; i++)

{

EPD_W21_CLK_0;

if(value & 0x80)

EPD_W21_MOSI_1;

else

EPD_W21_MOSI_0;

value = (value << 1);

EPD_W21_CLK_1;

}

}

 

This code implements writing data through the SPI communication protocol, and writes one byte at a time, which is 8 bits, so the for loop is used.
According to the timing diagram above, cycle 8 times, the value & 0x80 here is to judge whether the highest bit is 1 or 0,
If it is 1, it means MOSI=1, if it is 0, it means MOSI=0. Because the SPI write data starts from the highest bit but the data is stored in the lowest bit,
So it needs to be shifted one bit to the left, that is, value = (value << 1) so that it loops 8 times to get a byte.

 

b: CS and DC

CS and DC are used to write data and write commands (start writing data or commands when CS is low in the timing diagram;

write commands when DC=0, and write data when DC=1. After the end, CS returns to high level.)

 

void EPD_W21_WriteCMD(unsigned char command)//command write

{

EPD_W21_CS_0;

EPD_W21_DC_0; // command write

SPI_Write(command);

EPD_W21_CS_1;

}

void EPD_W21_WriteDATA(unsigned char data)//data write

{

EPD_W21_CS_0;

EPD_W21_DC_1; // data write

SPI_Write(data);

EPD_W21_CS_1;

}

 

c: RST is used at Initialization,0 and 1 stand for level

EPD_W21_RST_0; // Module reset

delay_xms(10);//At least 10ms delay

EPD_W21_RST_1;

delay_xms(10); //At least 10ms delay

 

d: Get level from BUSY,busy=1 is for BUSY state,it loops the while(1);busy=0, IDLE state, it will proceed to next line

void Epaper_READBUSY(void)

{

while(1)

{ //=1 BUSY

if(isEPD_W21_BUSY==0) break;;

}

}

 

Welcome you to message us either via SaleSmartly or email! We would love to hear from you so to offer better service.

Next time we will post more about the fast update, partial update and full screen update!!!

 

More Info:

GITHUB Library-Good Display E-paper(STM32/Arduino/ESP32/ESP8266)

 

 Encyclopedia of E-paper display!!! Your wonderful FAQ provider!

 

Contact us if you don't find the contents you need! And we will make sure they get published ASAP!!!

 

Prepare for your IMG easily via online tool ImageToArray!!!

 

GOOD DISPLAY BUY Good Display E-paper and development kit!!!

Scan the QR code to read on your phone

这是描述信息

Address:No.18, Zhonghua West Road, Dalian, China,116033  

E-mail: sales@eink-display.com

img img img
img img img

©2007-2021   Dalian Diamo Electronic Technology Co., Ltd.   All Rights Reserved.   辽ICP备08000578号-1   Website construction:www.300.cn dalian.300.cn 

Dalian Diamo Electronic Technology Co., Ltd.   

辽ICP备08000578号  
Website construction:www.300.cn
 jinzhou.300.cn