Template: 1.28inch LCD Module Interface

From Waveshare Wiki
Jump to: navigation, search

Interface Description

Raspberry Pi Hardware Connection

Please connect the LCD to your Raspberry Pi by the 8PIN cable according to the table below
Use the pin header or PH2.0 8PIN interface, you need to connect according to the following table

Connect to Raspberry Pi
LCD Raspberry Pi
BCM2835 Board
VCC 3.3V 3.3V
GND GND GND
DIN MOSI 19
CLK SCLK 23
CS CE0 24
DS 25 22
RST 27 13
BL 18 12

The 1.28inch LCD uses the PH2.0 8PIN interface, which can be connected to the Raspberry Pi according to the above table: (Please connect according to the pin definition table. The color of the wiring in the picture is for reference only, and the actual color shall prevail.)
800px

STM32 Hardware Connection

The example we provide is based on STM32F103RBT6, and the connection method provided is also the corresponding pin of STM32F103RBT6. If you need to transplant the program, please connect according to the actual pin.

STM32F103ZET connection pin correspondence
LCD STM32
VCC 3.3V
GND GND
DIN PA7
CLK PA5
CS PB6
DC PA8
RST PA9
BL PC7

Take the XNUCLEO-F103RB development board developed by our company as an example, the connection is as follows:
1.28-STM32.jpg

Arduino hardware connection

Arduino UNO Connection pin correspondence
LCD UNO
VCC 5V
GND GND
DIN D11
CLK D13
CS D10
DC D7
RST D8
BL D9

The connection diagram is as follows (click to enlarge):

1.14-Aduino.jpg

LCD and the controller

The built-in driver used in this LCD is GC9A01, with a resolution of 240RGB×240 dots, 129600 bytes of GRAM inside, and supports 12/16/18-bit data bus MCU interface, namely RGB444, RGB565, RGB666 three color formats. It is also a commonly used RGB format.
For most LCD controllers, the communication mode of the controller can be configured, usually with 8080 parallel interfaces, three-wire SPI, four-wire SPI, and other communication methods. This LCD uses a four-wire SPI communication interface, which can greatly save the GPIO port, and the communication speed will be faster.

  • Some friends may have doubts. The screen is circular, so which point is the first pixel of the screen? How to determine the coordinates?
    • In fact, you can understand that a square screen draws an inscribed circle in it. We only display the content in this inscribed circle, and the pixels in other positions are directly discarded. The same is true for most of the circular LCDs on the market.

Communication Protocol

0.96inch lcd module spi.png
Note: The difference from the traditional SPI protocol is that the data line sent from the slave to the host is hidden because it only needs to be displayed. Please refer to Datasheet Page 105 for the table.
RESX: reset, it is pulled low when the module is powered on, and it is usually set to 1;
CSX: the slave chip select, and the chip will be enabled only when CS is low.
D/CX: the data/command control pin of the chip, write command when DC = 0, write data when DC = 1
SDA: the transmitted data, that is, RGB data;
SCL: the SPI communication clock.
For SPI communication, data is transmitted with timing, that is, the combination of clock phase (CPHA) and clock polarity (CPOL):
The level of CPHA determines whether the serial synchronization clock is collected on the first clock transition edge or the second clock transition edge. When CPHA = 0, data acquisition is performed on the first transition edge;
The level of CPOL determines the idle state level of the serial synchronous clock. CPOL = 0, which is a low level.
As can be seen from the figure, when the first falling edge of SCLK starts to transmit data, 8bit data is transmitted in one clock cycle, using SPI0, bit-by-bit transmission, high-order first, low-order last.