6inch e-Paper HAT

From Waveshare Wiki
Jump to: navigation, search
6inch e-Paper raw Panel
6inch-e-Paper-1.jpg

800x600, 6inch EPD panel without driver board
6inch e-paper HAT
6inch-e-Paper-HAT-1.jpg

800x600, 6inch EPD HAT for Raspberry Pi, USB/SPI/I80/I2C interface
{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Note

6inch e-Paper is big size screen, the glass panel and FPC is fragile, please be careful when use it for developing. we recommend you to reinforce the FPC with scotch tape when developing. Please connect all the cables before powering the device, the device cannot support hot-plug.

There are two version, one is raw panel and another is HAT version. Driver board (IT8951) is required for raw panel, if you are the first time to buy this e-paper, recommend you to choose HAT version which come with the driver board.

Overview

Introduction

  • This product is an e-Paper HAT, 6 inches in size, with a resolution of 800×600. It uses IT8951 as the controller and can be controlled using USB/SPI/I80/I2C interfaces.
  • It features low power consumption, wide viewing angles, and a clear display even under direct sunlight. It is commonly used in applications such as shelf labels and industrial instruments for display purposes.

Features

  • No backlight, keeps displaying the latest content for a long time even when powered down.
  • Low power consumption, basically power is only required for refreshing.
  • Its design is based on the Raspberry Pi 40PIN GPIO interface, suitable for Raspberry Pi Zero/Zero W/Zero WH/2B/3B/3B+.
  • Lead out USB/SPI/I80/I2C control interface, which can be connected to main control boards such as Raspberry/Nucleo.
  • Provide online information manuals (example programs such as Raspberry/STM32).

Specification

  • Operating voltage: 5V
  • Interface: USB/SPI/I80/I2C
  • Outline dimension: 138.4mm × 101.8mm × 0.954mm
  • Display size: 122.4mm × 90.6mm
  • Dot pitch: 0.153mm × 0.151mm
  • Resolution: 800 × 600
  • Display color: black, white
  • Grayscale: 2-16 (1-4 bit)
  • Full refresh time: <1s
  • Refresh power: 0.6W (typ.)
  • Standby power: 0.3W (typ.)
  • Viewing angle: >170°

Working with Windows PC (USB)

Working Principle

The electronic paper in this product uses the "microcapsule electrophoresis display" technology. The principle is that the charged nanoparticles suspended in the liquid are migrated by the electric field. The e-paper screen displays patterns by reflecting ambient light and does not require a backlight. Under ambient light, the e-paper display screen is visible, with a viewing angle of almost 180°. Therefore, the e-paper display is perfect for reading.

  • Connect the e-paper to the driver board.
6inch-e-Paper-HAT-91.jpg
  • Connect the driver board to the PC by USB cable.
  • Download and run the E-LINK-TCON-DEMO software, you can download the software from #Resources.
  • Click connect.
6inch e-Paper HAT faq02.jpg
  • Check the "AutoSet" option, click "Open File" to select the picture, and click "OK" to confirm.
6inch-HD-e-Paper-HAT-Manual-903.jpg
  • Click Display to update the e-Paper.
6inch-HD-e-Paper-HAT-Manual-904.jpg
  • Note: If you want to use the USB interface to develop an e-Paper on Windows, you need to contact the Waveshare team and sign the NDA before you can get the E-LINK-TCON-DEMO source code.

Working with Raspberry Pi (SPI)

  • Hardware connection:
You should add the IT8951 Driver HAT on Raspberry Pi, communicating via the SPI interface.
6inch-e-Paper-HAT-user-Manual-06.jpg
You can also connect by wires:
Connect to Raspberry Pi via SPI
IT8951 Driver HAT Raspberry Pi (BCM) Description'
5V 5V 5V power input
GND GND Ground
MISO P9 MISO Pin of SPI
MOSI P10 MOSI Pin of SPI
SCK P11 SCK Pin of SPI
CS P8 Chip selection of SPI (Low active)
RST P17 Reset pin (Low active)
HRDY P24 Busy stats pin (Low when busy)
  • Set the DIP switch to SPI mode.
9.7inch-e-Paper-HAT-Manual-14.jpg
  • Open the terminal of Raspberry Pi, and install bcm2835 libraries.
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
# For more you can refer to the official website: http://www.airspayce.com/mikem/bcm2835/
  • Enable SPI interface
sudo raspi-config

Choose Interfacing Options -> SPI -> Yes.

  • Download demo codes and compile them.
    • Method 1: Download from our website. (Recommended)
sudo apt-get install p7zip-full
sudo wget  https://files.waveshare.com/upload/8/80/IT8951_20200319_Release.7z
7z x IT8951_20200319_Release.7z -O./IT8951
cd IT8951/
sudo make clean
sudo make -j4
    • Method 2: Download from GitHub:
git clone https://github.com/waveshare/IT8951-ePaper.git
cd IT8951-ePaper/Raspberry
sudo make clean
sudo make -j4
  • Check the VCOM value on the FPC.
6inch-HD-e-Paper-HAT-Manual-06.png

Add the VCOM value as a parameter and test the e-Paper, and this model is mode 0.

sudo ./epd -1.78 0
  • Demo execution phenomenon:

1) First, the r-paper will refresh the 16 gray bars partially in sequence.

2) Then demonstrate the demo of drawing lines, circles, rectangles, characters, and numbers.

3) Then respectively demonstrate the demo of displaying BMP pictures in 1bp, 2bp, and 4bp modes.

4) Next, demonstrate the effect of fast refresh in A2 mode.

5) Then display a gif animation.

6) Then demonstrate a Demo that counts the frame rate.

7) Finally, the e-paper is whitened in Init mode for long-term storage.

Working with STM32

Choose interface

  • SPI mode is recommended for driving as it requires fewer pins, offers a simpler driving method, and the communication speed meets the requirements of most scenarios.
  • I80 mode is an alternative if the application demands a communication speed higher than what the SPI interface can provide. It has the advantage of being relatively simple in driving method and very fast in communication speed, but it requires more pins.
  • I2C mode is not recommended due to its very slow communication

Driver Board Selection
Due to the larger RAM space required by IT8951, most STM32 microcontrollers are unable to meet this requirement directly. Additional chips such as SDRAM are needed for RAM expansion. For testing purposes, we're using the Open429I as the test board, which comes with the onboard IS42S16400J (64-MBIT) SDRAM. This SDRAM is fully capable of driving the 6-inch e-paper HAT.

SPI interface

IT8951 Driver HAT STM32 Description'
5V 5V 5V power input
GND GND Ground
MISO PE13 MISO Pin of SPI
MOSI PE14 MOSI Pin of SPI
SCK PE12 SCK Pin of SPI
CS PE11 Chip selection of SPI (Low active)
RST PC5 Reset pin (Low active)
HRDY PA7 Busy stats pin (Low when busy)
  • Set the switch to SPI mode
9.7inch-e-Paper-HAT-Manual-14.jpg
Unzip the demo codes and open the project by Keil. The path of the code is Open429I-C-6-IT8951-Demo\Project\6-IT8951\MDK-ARM\Project.uvproj.
Click compile, then open IT8951.h to ensure that IT8951_Interface_SPI is defined. Click on recompile and download. After a few seconds, you should be able to see the e-paper starting to cycle and display images normally.
9.7inch-e-Paper-HAT-Manual-15.jpg
  • You can check the debug information via UART interface
6inch-e-Paper-HAT-User-Manual-07.jpg

I80 interface

  • Step 1: Connect the e-Paper according to the following table:
IT8951 Driver HAT STM32 Description'
DBUS0~DBUS15 PB0~PB15 Data pins
HWE PC1 Write enable (Low active)
D/C PC7 Data/Command(Low for command)
CSEL PC6 Chip select enable (Low active)
HRD PC3 Read enable (Low active)
RST PC0 Reset pin (Low active)
BUSY PA7 Busy stats pin (Low when busy)
GND GND Ground
VCC 5V 5V power input
  • Step 2: Set the switch to I80
9.7inch-e-Paper-HAT-Manual-17.jpg
Unzip the demo codes and open the project by Keil. The path of the code is Open429I-C-6-IT8951-Demo\Project\6-IT8951\MDK-ARM\Project.uvproj.
Compile the project, and modify the IT8951.h file. Make sure IT8951_Interface_I80 is defined, click Recompile, and download. After a few seconds, you can see that the e-paper starts to display pictures in a loop.
9.7inch-e-Paper-HAT-Manual-15.jpg
  • You can check the debug information via the UART interface:
6inch-e-Paper-HAT-User-Manual-07.jpg

Make image arrays

For easy porting and use, we didn't use the file system in the STM32 code. The image shown is saved as arrays. Here show you how to make the image arrays.

  • Step 1: You should first make a BMP file, the resolution of the e-Paper is 800*600, the image is used directly here as an example.
  • Step 2: Open the software, and click on File -> Open... -> Select the above picture. as shown below:
6inch-e-Paper-HAT-Manual-09.jpg
  • Step 3: Click on Image -> Convert to -> Gray256 (8BPP), as shown below:

6inch-e-Paper-HAT-Manual-10.jpg

  • Step 4: Click on File -> Save As...-> Choose type "C" bitmap file (*.c) -> input the file name and save.
  • Step 5: Select 8 bits per pixel and OK to get the .c file.
9.7inch-e-Paper-HAT-Manual-21.jpg
  • Add the .c file to project and delete unuse information:
/*********************************************************************
*                SEGGER Microcontroller GmbH & Co. KG                *
*        Solutions for real time microcontroller applications        *
*                           www.segger.com                           *
**********************************************************************
*                                                                    *
* C-file generated by                                                *
*                                                                    *
*        Bitmap Converter for emWin V5.22.                           *
*        Compiled Jul  4 2013, 12:18:24                              *
*        (c) 1998 - 2013 Segger Microcontroller GmbH && Co. KG       *
*                                                                    *
**********************************************************************
*                                                                    *
* Source file: zoo_800_600                                           *
* Dimensions:  800 * 600                                             *
* NumColors:   256                                                   *
*                                                                    *
**********************************************************************
*/

#include <stdlib.h>

#include "GUI.h"

#ifndef GUI_CONST_STORAGE
  #define GUI_CONST_STORAGE const
#endif

extern GUI_CONST_STORAGE GUI_BITMAP bmzoo_800_600;

/*********************************************************************
*
*       Palette
*
*  Description
*    The following are the entries of the palette table.
*    The entries are stored as a 32-bit values of which 24 bits are
*    actually used according to the following bit mask: 0xBBGGRR
*
*    The lower   8 bits represent the Red   component.
*    The middle  8 bits represent the Green component.
*    The highest 8 bits represent the Blue  component.
*/
static GUI_CONST_STORAGE GUI_COLOR _Colorszoo_800_600[] = {
  0x000000, 0x010101, 0x020202, 0x030303,
  0x040404, 0x050505, 0x060606, 0x070707,
  0x080808, 0x090909, 0x0A0A0A, 0x0B0B0B,
  0x0C0C0C, 0x0D0D0D, 0x0E0E0E, 0x0F0F0F,
  0x101010, 0x111111, 0x121212, 0x131313,
  0x141414, 0x151515, 0x161616, 0x171717,
  0x181818, 0x191919, 0x1A1A1A, 0x1B1B1B,
  0x1C1C1C, 0x1D1D1D, 0x1E1E1E, 0x1F1F1F,
  0x202020, 0x212121, 0x222222, 0x232323,
  0x242424, 0x252525, 0x262626, 0x272727,
  0x282828, 0x292929, 0x2A2A2A, 0x2B2B2B,
  0x2C2C2C, 0x2D2D2D, 0x2E2E2E, 0x2F2F2F,
  0x303030, 0x313131, 0x323232, 0x333333,
  0x343434, 0x353535, 0x363636, 0x373737,
  0x383838, 0x393939, 0x3A3A3A, 0x3B3B3B,
  0x3C3C3C, 0x3D3D3D, 0x3E3E3E, 0x3F3F3F,
  0x404040, 0x414141, 0x424242, 0x434343,
  0x444444, 0x454545, 0x464646, 0x474747,
  0x484848, 0x494949, 0x4A4A4A, 0x4B4B4B,
  0x4C4C4C, 0x4D4D4D, 0x4E4E4E, 0x4F4F4F,
  0x505050, 0x515151, 0x525252, 0x535353,
  0x545454, 0x555555, 0x565656, 0x575757,
  0x585858, 0x595959, 0x5A5A5A, 0x5B5B5B,
  0x5C5C5C, 0x5D5D5D, 0x5E5E5E, 0x5F5F5F,
  0x606060, 0x616161, 0x626262, 0x636363,
  0x646464, 0x656565, 0x666666, 0x676767,
  0x686868, 0x696969, 0x6A6A6A, 0x6B6B6B,
  0x6C6C6C, 0x6D6D6D, 0x6E6E6E, 0x6F6F6F,
  0x707070, 0x717171, 0x727272, 0x737373,
  0x747474, 0x757575, 0x767676, 0x777777,
  0x787878, 0x797979, 0x7A7A7A, 0x7B7B7B,
  0x7C7C7C, 0x7D7D7D, 0x7E7E7E, 0x7F7F7F,
  0x808080, 0x818181, 0x828282, 0x838383,
  0x848484, 0x858585, 0x868686, 0x878787,
  0x888888, 0x898989, 0x8A8A8A, 0x8B8B8B,
  0x8C8C8C, 0x8D8D8D, 0x8E8E8E, 0x8F8F8F,
  0x909090, 0x919191, 0x929292, 0x939393,
  0x949494, 0x959595, 0x969696, 0x979797,
  0x989898, 0x999999, 0x9A9A9A, 0x9B9B9B,
  0x9C9C9C, 0x9D9D9D, 0x9E9E9E, 0x9F9F9F,
  0xA0A0A0, 0xA1A1A1, 0xA2A2A2, 0xA3A3A3,
  0xA4A4A4, 0xA5A5A5, 0xA6A6A6, 0xA7A7A7,
  0xA8A8A8, 0xA9A9A9, 0xAAAAAA, 0xABABAB,
  0xACACAC, 0xADADAD, 0xAEAEAE, 0xAFAFAF,
  0xB0B0B0, 0xB1B1B1, 0xB2B2B2, 0xB3B3B3,
  0xB4B4B4, 0xB5B5B5, 0xB6B6B6, 0xB7B7B7,
  0xB8B8B8, 0xB9B9B9, 0xBABABA, 0xBBBBBB,
  0xBCBCBC, 0xBDBDBD, 0xBEBEBE, 0xBFBFBF,
  0xC0C0C0, 0xC1C1C1, 0xC2C2C2, 0xC3C3C3,
  0xC4C4C4, 0xC5C5C5, 0xC6C6C6, 0xC7C7C7,
  0xC8C8C8, 0xC9C9C9, 0xCACACA, 0xCBCBCB,
  0xCCCCCC, 0xCDCDCD, 0xCECECE, 0xCFCFCF,
  0xD0D0D0, 0xD1D1D1, 0xD2D2D2, 0xD3D3D3,
  0xD4D4D4, 0xD5D5D5, 0xD6D6D6, 0xD7D7D7,
  0xD8D8D8, 0xD9D9D9, 0xDADADA, 0xDBDBDB,
  0xDCDCDC, 0xDDDDDD, 0xDEDEDE, 0xDFDFDF,
  0xE0E0E0, 0xE1E1E1, 0xE2E2E2, 0xE3E3E3,
  0xE4E4E4, 0xE5E5E5, 0xE6E6E6, 0xE7E7E7,
  0xE8E8E8, 0xE9E9E9, 0xEAEAEA, 0xEBEBEB,
  0xECECEC, 0xEDEDED, 0xEEEEEE, 0xEFEFEF,
  0xF0F0F0, 0xF1F1F1, 0xF2F2F2, 0xF3F3F3,
  0xF4F4F4, 0xF5F5F5, 0xF6F6F6, 0xF7F7F7,
  0xF8F8F8, 0xF9F9F9, 0xFAFAFA, 0xFBFBFB,
  0xFCFCFC, 0xFDFDFD, 0xFEFEFE, 0xFFFFFF
};

static GUI_CONST_STORAGE GUI_LOGPALETTE _Palzoo_800_600 = {
  256,  // Number of entries
  0,    // No transparency
  &_Colorszoo_800_600[0]
};

GUI_CONST_STORAGE GUI_BITMAP bmzoo_800_600 = {
  800, // xSize
  600, // ySize
  800, // BytesPerLine
  8, // BitsPerPixel
  _aczoo_800_600,  // Pointer to picture data (indices)
  &_Palzoo_800_600   // Pointer to palette
};
  • Step 7: Modify codes
static GUI_CONST_STORAGE unsigned char _aczoo_800_600[] = {
to (you can rename the array)
const unsigned char zoo_800_600[] = {
  • Step 8: Modify IT8951.c file, for example:
extern const unsigned char zoo_800_600[];
void IT8951DisplayExample3()
{
	IT8951LdImgInfo stLdImgInfo;
	IT8951AreaImgInfo stAreaImgInfo;
	TWord width = gstI80DevInfo.usPanelW;
	TWord high = gstI80DevInfo.usPanelH;
	TDWord i;
	
	for (i = 0;i < width*high;i++)
	{
		gpFrameBuf[i] = zoo_800_600[i];
	}

	IT8951WaitForDisplayReady();
	
	//Setting Load image information
	stLdImgInfo.ulStartFBAddr    = (TDWord)gpFrameBuf;
	stLdImgInfo.usEndianType     = IT8951_LDIMG_L_ENDIAN;
	stLdImgInfo.usPixelFormat    = IT8951_8BPP; 
	stLdImgInfo.usRotate         = IT8951_ROTATE_0;
	stLdImgInfo.ulImgBufBaseAddr = gulImgBufAddr;
	//Set Load Area
	stAreaImgInfo.usX      = 0;
	stAreaImgInfo.usY      = 0;
	stAreaImgInfo.usWidth  = width;
	stAreaImgInfo.usHeight = high;
	
	IT8951HostAreaPackedPixelWrite(&stLdImgInfo, &stAreaImgInfo);//Display function 2
	IT8951DisplayArea(0,0, gstI80DevInfo.usPanelW, gstI80DevInfo.usPanelH, 2);
}

Precautions

Connection

Due to updating, the hardware connection of e-Paper may be different as the picture showed, please connect the e-Paper according to the screen silk printing.

  • Example 1
20191213143317.png
  • Example 2
20191213141630.png

DIP switch

  • We recommend you use USB, I80, and SPI interfaces.
  • Whether you use USB, SPI, or I80 interface, you should turn the switch to ON as below:
20191213160132.png
  • If the E-LINK-TCON-DEMO fails to recognize the IT8951 when connected via USB to the PC, please check if the two sides of the DIP switches marked in the red box are connected. Only when both sides of the DIP switches marked in the red box are connected will the PC recognize it.

Select SPI or I80 Driver

  • If you adopt a USB driver, you do not need to pay attention to the DIP switch in the green box as shown below:
  • If you adopt the SPI driver or I80 driver, you need to pay attention to the DIP switch in the green box. If you switch to the I80, it indicates I80 driver is selected. If you switch to the SPI, it indicates I80 driver is selected.

7.8inch e-Paper HAT HC04.png

Demo Description

New Features

  • 1. Using 4bpp to refresh 16 levels of grayscale images, the amount of data transferred by SPI is reduced to half of the original, avoiding the waste of RAM and transfer time caused by using 8bpp to refresh 16 levels of grayscale images in the previous version.
  • 2. SPI transfer speed doubled, effective in Raspberry Pi 3 generation, Raspberry Pi 4 generation is not effective due to the increase of CPU main frequency.
  • 3. The time interval for refreshing pictures is reduced to 1/4 of the original one. It takes about 10S to refresh a 16-level grayscale BMP picture to 10.3-inch e-Paper (D) using GC16 mode in the previous version of the demo, but only about 3S in this demo.
  • 4. Avoid the memory leak caused by the allocation of cache after opening the bmp file in the previous version but not released.
  • 5. Add 1bpp, 2bpp, 4bpp, 8bpp mode support.
  • 6. Add the A2 mode refresh demo, you can feel the A2 mode refresh speed.
  • 7. Add support for drawing points, lines, circles, rectangles, writing characters, etc. Support grayscale selection of drawing characters and patterns, support 1bpp, 2bpp, 4bpp, 8bpp, if you choose 1bpp, also support A2 mode refresh.
  • 8. Add 1bpp, 2bpp, 4bpp, and 8bpp refresh support for bmp pictures, if you choose 1bpp, also support A2 mode refresh.
  • 9. Add the demo of displaying GIF pictures, which can write multiple pictures to IT8951 cache, and then directly refresh the data in the cache to the ink screen when displaying, eliminating the data transfer process between RPi and IT8951, and refreshing the frame rate up to 7fps.
  • 10. Add frame rate test demos to test the frame rate when refreshing different size areas, 1bpp, 2bpp, 4bpp, 8bpp, A2 mode, and GC16 mode.
  • 11. Support enhanced drive capability to avoid partial blurring of the screen display in some cases.
  • 12. Support 4-byte alignment for 6-inch ePaper HAT and 6-inch HD ePaper HAT to avoid abnormal display when 1bpp is refreshed.
  • 13. Demos need to enter VCOM when running, and the end of the demo will be fully painted white to protect the screen and extend the life of the screen.
  • 14. Optimize the demo structure, reduce the coupling of the program, and standardize some functions, and variable naming.

Demo Description

Refresh 16 Grayscale Bars with Light to Dark Gray Levels in Sequence

  • Function name: DisplayColorPaletteExample
  • This demo shows how to use 4bp, combined with GC16 mode, to partially refresh 16 grayscale bars from light to dark in sequence.

Draw Points, Lines, Circles, Rectangles and Characters

  • Function name: DisplayCharacterPatternExample
  • The demo demonstrates, how to draw points, lines, circles, rectangles, and write characters, supports 1bpp, 2bpp, 4bpp, and 8bpp, and if 1bpp is used, it also supports A2 mode refresh.

Display BMP Pictures

  • Function name: DisplayBMPExample
  • The demo demonstrates how to refresh a bmp image, supporting 1bpp, 2bpp, 4bpp, and 8bpp, and if 1bpp is used, A2 mode refresh is also supported.

A2 Mode Refresh Example

  • Function name: DynamicRefreshExample
  • This demo demonstrates how to use A2 mode for refreshing. In this demo, it will be refreshed several times, the refresh area will keep changing, and the area of the refresh area will gradually become larger, after several times of refreshing, the residual shadow will appear, and INIT mode will be used to clear the residual shadow. With this demo, you can feel the refresh speed of the A2 mode.

Display GIF Pictures

  • Function name: DynamicGIFExample
  • The demo demonstrates how to refresh a GIF image. In this demo, a GIF image is split into 7 bmp images beforehand, and the 7 bmp images are written to the cache of the IT8951 in succession, and when displaying, the image data is read out from the cache of the IT8951 at the corresponding address and refreshed to the E-paper display.

Frame Rate Test

  • Function name: CheckFrameRateExample
  • This demo is designed to facilitate testing: the frame rate of refresh when refreshing different size areas, 1bpp, 2bpp, 4bpp, 8bpp, and A2 mode, GC16 mode, in this demo, the time to refresh 10 frames of images will be counted automatically and the frame rate (fps) will be calculated automatically.

Related Description

Mode Description

IT8951 for different resolutions of the screen brushed into different firmware, different firmware has different refresh modes, see E-paper-mode-declaration for details, the modes used in the demo are INIT mode, GC16 mode, and A2 mode.

The following is a brief description of the relevant modes:

Mode Features 6inch/6inch HD 7.8inch/9.7inch/10.3inch
INIT Used to erase the display content, and clear the screen. It is recommended to use INIT mode to clear the screen after several A2 mode refreshes Mode0 Mode0
GC16 Adopt 16 levels of grayscale to update the screen display content, the best display effect Mode2 Mode2
A2 Only black and white can be refreshed, but the refresh speed is the fastest Mode4 Mode6
//basic mode definition
UBYTE INIT_Mode = 0;
UBYTE GC16_Mode = 2;
//A2_Mode's value is not fixed, is decided by the firmware's LUT 
UBYTE A2_Mode = 6;
if( strcmp(LUT_Version, "M641") == 0 ){
    //6inch e-Paper HAT(800,600), 6inch HD e-Paper HAT(1448,1072), 6inch HD touch e-Paper HAT(1448,1072)
    A2_Mode = 4;
    Four_Byte_Align = true;
}else if( strcmp(LUT_Version, "M841") == 0 ){
    //9.7inch e-Paper HAT(1200,825)
    A2_Mode = 6;
}else if( strcmp(LUT_Version, "M841_TFA2812") == 0 ){
    //7.8inch e-Paper HAT(1872,1404)
    A2_Mode = 6;
}else if( strcmp(LUT_Version, "M841_TFA5210") == 0 ){
    //10.3inch e-Paper HAT(1872,1404)
    A2_Mode = 6;
}else{
    //default set to 6 as A2 Mode
    A2_Mode = 6;
}

BPP Description

BPP (Bits Per Pixel), which indicates the number of bits occupied by a pixel, currently, all screens support 1bpp, 2bpp, 4bpp, 8bpp mode refresh.

  • 1bpp
  • Each pixel occupies 1 bit.
  • Can display 2(2^1=2) levels of grayscale, suitable for A2 mode (can only update 2 levels of grayscale in black and white)
  • Each byte can store 8-pixel points.
  • Pixel points are stored in 1 byte in RAM in large end order:

7.8inch e-Paper HAT17.png

  • In IT8951 default uses a small end sequence, need to convert the big end sequence to a small end sequence.
  • 2bpp
  • Each pixel occupies 2 bits.
  • Capable of displaying 4(2^2=4) levels of grayscale.
  • Each byte can store 4-pixel points.
  • Pixel points are stored in RAM in large end order per 1 byte:

7.8inch e-Paper HAT18.png

  • In IT8951 default uses a small end sequence, need to convert the big end sequence to a small end sequence.
  • 4bpp
  • Each pixel occupies 4 bits.
  • Capable of displaying 16(2^4=16) levels of grayscale.
  • Each byte can store 2-pixel points.
  • Pixel points are stored in RAM in large end order for each 1 byte:

7.8inch e-Paper HAT19.png

  • In IT8951 default uses a small end order, need to convert the big end order to a small end order.
  • It is recommended to use 4bpp for a refreshing, which can display 16 levels of grayscale, and compared to 8bpp, the amount of transmitted data is reduced by half, the transmission speed is twice as fast, and there is no difference in display effect.
  • 8bpp
  • Each pixel occupies 8 bits.
  • Can display 256 (2^8=256) levels of grayscale, but in IT8951 only the high 4 bits are taken, so only 16 levels of grayscale can be displayed.
  • Each byte can store 1 pixel.
  • Pixel points are stored in RAM in large end order per 1 byte:

7.8inch e-Paper HAT20.png

  • In IT8951, the small end order is used by default, and it is necessary to convert the big end order to the small end order
  • To get the corresponding grayscale image from the original image in the program, the specific operation is: whether drawing points, drawing lines, or getting the image, each pixel point obtained is 1 byte (8 bits), if you want to get the corresponding grayscale, you only need to get the corresponding high bit of the byte. For example, if you want to get 2bpp pixel points, you only need to get the high 2 bits from 8bpp (8 bits). The specific operation is shown in the following program, in which each byte in RAM is also converted from big-endian to little-endian.


UDOUBLE Addr = X * (Paint.BitsPerPixel) / 8 + Y * Paint.WidthByte;
switch( Paint.BitsPerPixel ){
    case 8:{
        Paint.Image[Addr] = Color & 0xF0;
        break;
    }
    case 4:{
        Paint.Image[Addr] &= ~( (0xF0) >> (7 - (X*4+3)%8 ) );
        Paint.Image[Addr] |= (Color & 0xF0) >> (7 - (X*4+3)%8 );
        break;
    }
    case 2:{
        Paint.Image[Addr] &= ~( (0xC0) >> (7 - (X*2+1)%8 ) );
        Paint.Image[Addr] |= (Color & 0xC0) >> (7 - (X*2+1)%8 );
        break;
    }
    case 1:{
        Paint.Image[Addr] &= ~( (0x80) >> (7 - X%8) );
        Paint.Image[Addr] |= (Color & 0x80) >> (7 - X%8);
        break;
    }
}

4-byte Alignment Description

In the actual test, we found that for 6inch e-Paper HAT, 6inch HD e-Paper HAT, and 6inch HD touch e-Paper HAT, when using 1bpp mode refresh, the starting point X and refresh width W of the refresh area need to be aligned with 4 bytes (32bit), otherwise, the image of the refresh area will be displayed abnormally, as shown in the following procedure:

if( strcmp(LUT_Version, "M641") == 0 ){
    //6inch e-Paper HAT(800,600), 6inch HD e-Paper HAT(1448,1072), 6inch HD touch e-Paper HAT(1448,1072)
    A2_Mode = 4;
    Four_Byte_Align = true;
}else if( strcmp(LUT_Version, "M841") == 0 ){
...
}
if(Four_Byte_Align == true){
    In_4bp_Refresh_Area_Width = Panel_Width - (Panel_Width % 32);
}else{
    In_4bp_Refresh_Area_Width = Panel_Width;
}
X_Start = Min_X < 32 ? 0 : Min_X - (Min_X % 32);
Debug("X_Start:%d\r\n",X_Start);
X_End = ( Max_X + (32 - (Max_X % 32)) ) > Touch_Pannel_Area_Width ? ( Max_X - (Max_X % 32) )  : ( Max_X + (32 - (Max_X % 32)) );
Debug("X_End:%d\r\n",X_End);
Y_Start = Min_Y;
Debug("Y_Start:%d\r\n",Y_Start);
Y_End = Max_Y;
Debug("Y_Start:%d\r\n",Y_End);
Width = X_End - X_Start;
if(Width<=0){
    Width = 32;
}
Debug("Width:%d\r\n",Width);
Height = Y_End-Y_Start;
if(Height<=0){
    Height = 32;
}
Debug("Height:%d\r\n",Height);

SPI Transfer Speed Description

Due to the difference in CPU main frequency of Raspberry Pi 3 and Raspberry Pi 4:

  • Raspberry Pi 3 can still transmit normally when it adopts 16 division frequency, and the fastest can only adopt 16 division frequency.
  • While Raspberry Pi 4B adopts 16 divisions, the SPI rate is too high, and there will be transmission errors, so the SPI of Raspberry Pi 4B can only use 32 divisions at the fastest.
  • BCM2835 library manual, different Raspberry Pi version, different clock frequency, the corresponding frequency description is shown below:

7.8inch e-Paper HAT23.png

  • If you need to obtain the most suitable SPI transfer speed, you need to select a different SPI clock division according to your Raspberry Pi version, as shown in the following program and its comments:
bcm2835_spi_begin();//Start spi interface, set spi pin for the reuse function
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST);//High first transmission
bcm2835_spi_setDataMode(BCM2835_SPI_MODE0);//spi mode 0

//bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_16);//For RPi 3/3B/3B+
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_32);//For RPi 4B

/* SPI clock reference link:*/
/*http://www.airspayce.com/mikem/bcm2835/group__constants.html#gaf2e0ca069b8caef24602a02e8a00884e*/

Enhance Driving Ability

In some cases, due to the FPC line being too long and other reasons, will lead to the ink screen display partial blur, at this time, trying to enhance the drive capability, can effectively solve the problem of the blurred screen display.
Specific procedures are shown below:

#if(Enhance)
    Debug("Attention! Enhanced driving ability, only used when the screen is blurred\r\n");
    Enhance_Driving_Capability();
#endif
/******************************************************************************
function:  Enhanced driving capability
parameter:  Enhanced driving capability for IT8951, in case the blurred display effect
******************************************************************************/
void Enhance_Driving_Capability(void)
{
    UWORD RegValue = EPD_IT8951_ReadReg(0x0038);
    Debug("The reg value before writing is %x\r\n", RegValue);
    EPD_IT8951_WriteReg(0x0038, 0x0602);
    RegValue = EPD_IT8951_ReadReg(0x0038);
    Debug("The reg value after writing is %x\r\n", RegValue);
}

If the E-LINK-TCON-DEMO software is used on a PC (Windows) to refresh the E-paper via the USB interface, the drive can be enhanced by modifying the register values as follows:

  • Step 1: Read the data of the registered address 0x18000038.

7.8inch e-Paper HAT21.png
If the data of the read register address 0x18000038 is 0x02, it means that the driver is not yet enhanced.

  • Step 2: Modify the data of register address 0x18000038.

7.8inch e-Paper HAT22.png
Modify the data of register address 0x18000038 to 602 to enhance the driving capability.

  • Step 3: Check the data of register address 0x18000038.

7.8inch e-Paper 23.png
Check whether the data of register address 0x18000038 is modified successfully. If the data of this address is 0x602, it means that the driving capability has been enhanced and the screen can be brushed in this state to avoid the blurred display in some cases, such as when the FPC line is too long and the production batch is different.

Use Correct VCOM Value

The VCOM value of each E-paper has certain differences. The VCOM value of each E-paper is marked on the FPC cable, so make sure the correct VCOM value is used in each execution of the demo, otherwise, the display will become worse if the E-paper works under the wrong VCOM value for a long time.

Development Description

The above only illustrates how to use the 7.8-inch e-Paper HAT (D). For details on how to modify and perform secondary development, users need to consult the relevant code by themselves.

Please refer to the IT8951 information provided in the Resource.

Resources

Document

Schematic

Demo code

Datasheet

Software

Other documents


FAQ

Questions About Software & Hardware

 Answer:

The most likely reason for not being able to print the picture is that the wires are not connected correctly. Please check the wiring. Due to the different batches of products, the wiring method may not be exactly the same as the picture. Please refer to the cable and 1 and 40 on the silk screen. Connect as shown in the red line mark in the figure below:
Faqe-link.png

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

1. Replace the Micro USB cable with good quality. There are many USB cables on the market that have too much voltage drop, which will cause the USB interface to fail to enumerate normally.
2. Try changing the USB interface. It is recommended to use the USB interface on the back of the PC. Relatively speaking, the power supply current will be larger.
3. Turn the DIP switch to the end. During shipping, the DIP switches may be loosened, and the floating configuration pins cannot put the IT8951 into USB mode.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

Click connect. The following information will be displayed normally (different models will display different information):
Connect.png
If you fail to refresh, check whether the hard link is normal, use the USB port on the back of the PC (most of the USB ports on the front of the PC have weak power supply capability), and replace the e-paper to test.
Note: Do not plug and unplug the e-paper with power on, otherwise the driver board and e-paper may be damaged.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

Yes, but the CS, RST, and HRDY pins of the second screen need to be connected to different pins on the controller for individual control.

{{{5}}}


Questions About Screen

 Answer:
  • 【Operating condition】Temperature range: 0~50°C; Humidity range: 35%~65%RH
  • 【Storage condition】Temperature range: below 30°C; Humidity range: below 55%RH; Maximum storage time: 6 months
  • 【Transportation condition】Temperature range: -25~70°C; Maximum shipping time: 10 days
  • 【After unpacking】Temperature range: 20°C±5°C; Humidity range: 50±5%RH; Maximum storage time: Assembled within 72 hours

{{{5}}}


 Answer:
  • Refresh mode:
    • Full refresh: The e-paper screen will flicker several times during refreshing (the flicking times depend on the refresh time), and the flicker is to remove the ghosting to achieve the best display effect.
    • Partial refresh: The e-paper screen has no flickering effect during refreshing. Users who use partial flashing should pay attention to performing a full flashing operation to remove the ghosting after refreshing several times, otherwise, the ghosting problem will become more and more serious, or even damage the screen. (At present, only some black and white e-paper screens support partial refreshing, please refer to the product page for details).
  • Refresh frequency:
    • During use, it is recommended that customers set the refresh interval of the e-ink screen to at least 180 seconds. (Except for products that support the partial refreshing function)
    • During the standby process (that is, after the refresh operation), it is recommended that the customer set the e-paper screen to sleep mode, or power off (the power supply part of the e-paper screen can be disconnected with an analog switch) to reduce power consumption and prolong the life of the e-paper screen. (If some e-paper screens are powered on for a long time, the screen will be damaged beyond repair.)
    • During the use of the e-paper screen, it is recommended that customers update the display screen at least every 24 hours. (If the screen keeps the same picture for a long time, there will be a burn-in situation that is difficult to repair).
  • Application scenarios:
    • The e-paper screen is recommended for indoor use. If it is used outdoors, it is necessary to prevent the e-paper screen from being exposed to direct sunlight, and at the same time, it is necessary to take ultraviolet protection measures, because charged particles will dry out under strong light for a long time, resulting in loss of activity and failure to refresh. This situation is irreversible. When designing electronic ink screen products, customers should pay attention to determine whether the use environment meets the requirements of electronic ink screens.

{{{5}}}


 Answer:

Ideally, with normal use, it can be refreshed 1,000,000 times (1 million times).

{{{5}}}


 Answer:

Power on the development board for a long time, after each refresh operation, it is recommended to set the screen to sleep mode or directly power off, otherwise, the screen may burn out when the screen is in a high voltage state for a long time.

{{{5}}}


 Answer:

Yes, but you need to re-initialize the electronic paper with software.

{{{5}}}



Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)