Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
【Note】: Refresh time:The data provided is experimental data, the actual time may be a little different.It is normal that the e-Paper blink when full updating.
Power:The power data is experimental data.
SPI communication has data transfer timing, which is combined by CPHA and CPOL.
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. Here, SPI0 is in used, and data is transferred by bits, MSB first.
As we know, this display uses the SPI interface, however, there are two FPC cables. In fact, the 12.48inch e-Paper is combined by four small e-Paper, therefore, to control the e-Paper, you should use four chip select pin.
It works as below:
We name the four areas as S2, M2, M1 and S1 respectively, in demo codes, we will send data to these four area in order.
The resolution of S2 and M1 are same 648*492, and the resolution of M2 and S1 are the same 656*492.
Combine the four display we get the resolution of 12.48inch e-Paper: 1304*984
They are four display indeed, therefore, we need to control four SPI salves:
Generally, the control pins of e-Paper are MOSI, SCLK, CS and DC
And power and reset pins: VCC, GND, RST
Because e-Paper will flash when updating, there is a busy pin:BUSY
To reduce pins, four displays use the same VCC, GND, MOSI and SCK pins. Every two displays use the same DC and RST pins.
Therefore, there are total 16 pins for controlling the e-Paper:
To control the e-Paper, you should first reset and initialize registers. And then transmit image data to e-Paper and update.
Here we show you how to transmit the image data:
We take Black-white or Red-white image as a monochrome bitmap. One byte stands for 8 pixels.
S2 and M1: There are 648 pixels per raw, It needs 648/8 = 81 bytes. One display has 492 column,totally have 81 * 492 = 39852 bytes. The same as the M2 and S1: They totally have 40344 per display。
Registers 0x13 and 0x10 are used to control Black-white image data and Red image data transmitting, here we take two-color display as example
Color | 0x10 | 0x13 |
White | 0xFF | 0x00 |
Black | 0x00 | 0x00 |
Red | 0xFF/0x00 | 0xFF |
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.
The pins used can be found on schematic according to codes
Open terminal and type command
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes. Then reboot the Raspberry Pi
sudo reboot
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
sudo apt-get install wiringpi cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v
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
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
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
cd c sudo nano examples/main.c
sudo make clean sudo make sudo ./epd
cd python/examples
sudo python epd_12in48_test.py
sudo python epd_12in48B_test.py
cd python/examples
sudo python Show_EN_Weather.py
sudo python Show_EN_Weather.py B
sudo python Show_EN_Weather.py help
You can directly insert the Arduino UNO to PCB
About the pins used:
The development board we use is Waveshare Open103Z. The project is developed based on STM32 HAL libraries.
To assemble the Open32, you should connect it by wires provided.
About the pins used, you can refer to e-paper.ioc file.
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.
The demo codes for ESP32 are developed with Arduino IDE as well.
To develop ESP32, you should first set up the environment.
Here we use Waveshare e-Paper ESP32 Driver Board as an example. Attach it on PCB.
About the pins used, you can refer to schematic and codes
Open Arduino IDE software, and find the examples on File->Examples
If you use two-color e-Paper, choose the epd12in48-demo, otherwise, use the epd12in48B-demo
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.
: