Surenoo SSP0180B-128160 Series SPI TFT LCD Module User Manual
- June 9, 2024
- Surenoo
Table of Contents
- Surenoo SSP0180B-128160 Series SPI TFT LCD Module
- Product Description
- Product Features
- Product Parameters
- Interface Description
- Hardware Configuration
- Working principle
- Instructions for use
- Software Description
- Common software
- References
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
Surenoo SSP0180B-128160 Series SPI TFT LCD Module
Product Description
This product is a 1.8 inch LCD display module. It has 128×160 resolution, supports 16BIT RGB 65K color display, and the internal driver IC is ST7735S, which uses 4-wire SPI communication. The module contains an LCD display and a PCB control backplane.
Product Features
- 1.8-inch color screen, support 16BIT 65K color display, display rich colors
- 128X160 resolution, clear display
- Using the SPI serial bus, it only takes a few IOs to illuminate the display
- With SD card slot for convenient function expansion
- Provide underlying libraries and rich sample programs for Arduino, C51, and STM32 platforms
- Military-grade process standards, long-term stable work
- Provide underlying driver technical support
Product Parameters
Name | Description |
---|---|
Display Color | 16BIT RGB 65K color |
SKU | MSP1804 |
Screen Size | 1.8(inch) |
Type | TFT |
Driver IC | ST7735S |
Resolution | 128*160 (Pixel) |
Module Interface | 4-wire SPI interface |
Backlight | 2 White Led |
Active Area | 28.03×35.04 (mm) |
Module PCB Size | 44.96×53.47 (mm) |
Angle of view | 12 O’clock |
--- | --- |
Operating Temperature | -10℃~70℃ |
Storage Temperature | -20℃~70℃ |
Operating Voltage | 3.3V / 5V |
Power Consumption | About 90mA |
Product Weight | About 25(g) |
Interface Description
Number | Module Pin | Pin Description |
---|---|---|
1 | RST | LCD reset control pin (low Level reset) |
2 | CS | LCD chip select control pin (low level enable) |
3 | D/C | LCD data/command selection control pin (high level: data, low |
level: command)
---|---|---
4| DIN| LCD SPI bus write data pin
5| CLK| LCD SPI bus clock pin
6| VCC| LCD Power positive pin
7| BL| LCD backlight control signal (high level lighting, if you do not
need control, please connect 3.3V)
8| GND| LCD Power ground pin
Description:
- When manually wiring, reduce the occupied IO port of the development board as follows:
- When the SPI multiplexed chip is not selected, ground the CS pin of the module to save 1 IO port;
- When the backlight is not needed, connect the module LED pin to 5V or 3.3V, saving 1 IO port;
- Connect the RST pin of the module to the reset end of the MCU to save 1 IO port;
- After the module VCC and GND are connected, the LED pin is connected to 3.3V/5V or high level, and the backlight is normally lit to prove that the backlight is normal;
- Regarding J1 shorted or disconnected, the VCC connection method has the following conditions:
- Using the Arduino platform, if an external level conversion module is used, J1 is disconnected, VCC can only be connected to 5V, J1 is shorted, and VCC is connected to 3.3V or 5V. If the level conversion module is not connected, J1 must be shorted and The module can operate normally, at this time VCC can only be connected to 5V;
- Using the C51 platform, when using the STC12C5A60S2 hardware SPI test program, if the external level conversion module is used, J1 is disconnected, VCC can only be connected to 5V, J1 is shorted, VCC is connected to 3.3V or 5V; For the module, J1 must be shorted for normal operation. At this time, VCC can only be connected to 5V. When using other test procedures, if J1 is disconnected, VCC can only be connected to 5V; if J1 is shorted, VCC is connected to 3.3V or 5V;
- using STM32 platform, if J1 is disconnected, VCC can only be connected to 5V; if J1 is shorted, VCC is connected to 3.3V or 5V;
Hardware Configuration
- The LCD module hardware circuit comprises two parts: an LCD display control circuit and a backlight control circuit.
- The LCD display control circuit is used to control the pins of the LCD, including control pins and data transfer pins.
- The backlight control circuit is used to control the backlight to be on and off. Of course, if the backlight is not required to be controlled, the backlight control pin can be directly connected to the 3.3V power supply without using the circuit.
Working principle
Introduction to ST7735S Controller
The ST7735S controller supports a maximum resolution of 132*162 and a
48114-byte GRAM. It also supports 8-bit, 9-bit, 16-bit, and 18-bit parallel
port data buses. It also supports 3-wire and 4-wire SPI serial ports. Since
parallel control requires a large number of IO ports, the most common one is
SPI serial port control. The ST7735S also supports 65K, 262K RGB color
display, display color is very rich, while supporting rotating display and
scroll display and video playback, display in a variety of ways.
The ST7735S controller uses 16bit (RGB565) to control a pixel display, so it
can display up to 65K colors per pixel. The pixel address setting is performed
in the order of rows and columns, and the incrementing and decreasing
direction is determined by the scanning mode. The ST7735S display method is
performed by setting the address and then setting the color value.
Introduction to SPI communication protocol
The 4-wire SPI bus write mode timing is shown in the following figure:
CSX is a slave chip select, and the chip is enabled only when
CSX is low.
D/CX is the data/command control pin of the chip. When DCX is low, the command
is written. When it is high, the data is written.
SCL is the SPI bus clock, and each rising edge transmits 1 bit of data;
SDA is the data transmitted by SPI, and it transmits 8-bit data at a time.
The data format is as shown below:
The high position is in front and transmitted first.
For SPI communication, the data has a transmission timing, that is, a
combination of clock phase (CPHA) and clock polarity (CPOL):
The CPOL level determines the idle state level of the serial synchronous
clock, CPOL = 0, which is low. CPOL does not have a lot of impact on the
transport protocol;
The level of CPHA determines whether the serial synchronous clock is acquired
on the first clock transition edge or the second clock transition edge.
When CPHL = 0, data acquisition is performed on the first edge of the
transition;
The combination of the two becomes the four SPI communication methods. SPI0 is
usually used in China, that is, CPHL = 0, CPOL = 0.
Instructions for use
Arduino instructions
Wiring instructions:
Arduino UNO microcontroller test program wiring
Number| Module Pin| Corresponding to UNO development board
wiring pins
1| RST| A4
2| CS| A5
3| D/C| A3
4| DIN| 11
5| CLK| 13
6| VCC| 5V
7| BL| A0
8| GND| GND
Arduino MEGA2560 microcontroller test program wiring
Number| Module Pin| Corresponding to MEGA2560 development
board wiring pins
1| RST| A4
2| CS| A5
3| D/C| A3
4| DIN| 51
5| CLK| 52
6| VCC| 5V
7| BL| A0
8| GND| GND
Operating Steps:
-
First refer to the method of running the SPI module on the Arduino.
The specific method is as follows:
http://www.lcdwiki.com/Run_Arduino_Demo_in_spi_model -
Connect the LCD module and the Arduino MCU according to the above wiring instructions, and power on;
-
Copy the dependent libraries in the Install libraries directory of the test package to the libraries folder of the Arduino project directory (if you do not need to depend on the libraries, you do not need to copy them);
-
Open the directory where the Arduino test program is located and select the example you want to test, as shown below:
(Please refer to the test program description document in the test package for the test program description)
-
Open the selected sample project, compile and download.
The specific operation methods for the Arduino test program relying on library copy, compile and download are as follows:
http://www.lcdwiki.com/res/PublicFile/Arduino_IDE_Use_Illustration_EN.pdf -
If the LCD module displays characters and graphics normally, the program runs successfully;
C51 instructions
Wiring instructions:
STC89C52RC and STC12C5A60S2 microcontroller test program wiring instructions
Number| Module Pin| Corresponding to STC89/STC12 development
board wiring pin
1| RST| P33
2| CS| P13
3| D/C| P12
4| DIN| P15
5| CLK| P17
6| VCC| 5V/3.3V
7| BL| P32
8| GND| GND
Operating Steps:
-
If you use the STC12C5A60S2 hardware SPI test program, you need to refer to the following web page method:
http://www.lcdwiki.com/Run_Arduino_Demo_in_spi_model -
Connect the LCD module and the C51 MCU according to the above wiring instructions, and power on;
-
Select the C51 test program to be tested, as shown below:
(Please refer to the test program description document in the test package for the test program description)
-
Open the selected test program project, compile and download; detailed description of the C51 test program compilation and download can be found in the following document:
http://www.lcdwiki.com/res/PublicFile/C51_Keil%26stc- isp_Use_Illustration_EN.pdf -
If the LCD module displays characters and graphics normally, the program runs successfully;
STM32 instructions
Wiring instructions:
Because the pin positions of different development boards are different, and
the external pins are reserved differently (some development boards do not
have externally required pins). In order to facilitate wiring, the wiring pins
of each development board are inconsistent.
STM32F103RCT6 microcontroller test program wiring instructions
Number| Module Pin| Corresponding to MiniSTM32 development
board wiring pin
1| RST| PB12
2| CS| PB11
3| D/C| PB10
4| DIN| PB15
5| CLK| PB13
6| VCC| 5V/3.3V
7| BL| PB9
8| GND| GND
STM32F103ZET6 microcontroller test program wiring
instructions
Number| Module Pin| Corresponding to Elite STM32 development
board wiring pin
1| RST| PB12
2| CS| PB11
---|---|---
3| D/C| PB10
4| DIN| PB15
5| CLK| PB13
6| VCC| 5V/3.3V
7| BL| PB9
8| GND| GND
STM32F407ZGT6 microcontroller test program wiring
instructions
Number| Module Pin| Corresponding to Explorer STM32F4
development board wiring pin
1| RST| PB12
2| CS| PB15
3| D/C| PB14
4| DIN| PB5
5| CLK| PB3
6| VCC| 5V/3.3V
7| BL| PB13
8| GND| GND
STM32F429IGT6 microcontroller test program wiring
instructions
Number| Module Pin| Corresponding to Apollo STM32F4/F7
development board wiring pin
1| RST| PD12
2| CS| PD11
3| D/C| PD5
4| DIN| PF9
---|---|---
5| CLK| PF7
6| VCC| 5V/3.3V
7| BL| PD6
8| GND| GND
Operating Steps:
-
Connect the LCD module and the STM32 MCU according to the above wiring instructions, and power on;
-
Select the test example according to the model of the microcontroller, as shown in the following figure:
(Please refer to the test program description document in the test package for the test program description) -
Open the selected test program project, compile and download; detailed description of the STM32 test program compilation and download can be found in the following document:
http://www.lcdwiki.com/res/PublicFile/STM32_Keil_Use_Illustration_EN.pdf -
If the LCD module displays characters and graphics normally, the program runs successfully;
Software Description
Code Architecture
- Arduino code architecture description The code architecture is shown below:
- Arduino’s test program code consists of two parts: the LCDWIKI library and application code.
- The LCDWIKI library consists of two parts: the LCDWIKI_SPI library and the LCDWIKI_GUI library.
- The application contains several test examples, each of which contains different test content.
- LCDWIKI_SPI is the underlying library, which is associated with hardware. It is mainly responsible for operating registers, including hardware module initialization, data and command transmission, pixel coordinates and color settings, and display mode configuration.
- LCDWIKI_GUI is a middle-tier library, which is responsible for drawing graphics and displaying characters using the API provided by the underlying library.
- The application uses the API provided by the LCDWIKI library to write some test examples to implement some aspects of the test function.
- C51 and STM32 code architecture description
- The code architecture is shown below:
- The Demo API code of the main program runtime is included in the test code; LCD initialization and related operations are included in the LCD code;
- Drawing points, lines, graphics, and Chinese and English character display related operations are included in the GUI code;
- The main function implements the application to run;
- Platform code varies by platform;
- SPI initialization and configuration related operations are included in the SPI code(C51’s SPI code is placed in the LCD code);
- The key processing related code is included in the key code (the C51 platform does not have a button processing code);
- The code related to the led configuration operation is included in the led code;
software SPI and hardware SPI description
The LCD module provides software SPI and hardware SPI sample code (except STC89C52RC, because it does not have hardware SPI function), the two sample code does not make any difference in the display content, but the following aspects are different:
-
display speed
The hardware SPI is significantly faster than the software SPI, which is determined by the hardware. -
GPIO definition
The software SPI all control pins must be defined, any idle pin can be used, the hardware SPI data and clock signal pins are fixed (depending on the platform), other control pins should be defined by themselves, or any idle reference can be used. foot. -
initialization
When the software SPI is initialized, only the GPIO for pin definition needs to be initialized (not required by the C51 platform). When the hardware SPI is initialized, the relevant control registers and data registers need to be initialized.
GPIO definition description
-
Arduino test program GPIO definition description
The GPIO definitions for the Arduino test program are placed separately in each application. As shown in the figure below (take the UNO software SPI test program as an example):
When using the Arduino hardware SPI test program, the SDA and SCK pins cannot be modified (it is defined by the system and need not be defined), and other GPIOs can be flexibly defined according to requirements. -
C51 test program GPIO definition description
C51 test program GPIO definition is placed in the lcd.h file, as shown below(Taking the STC12C5A60S2 software SPI test program as an example):
If the software SPI is used, all pin definitions can be modified and can be defined as any other free GPIO.
If hardware SPI is used, the LCD_BL, LCD_RS, LCD_CS, and LCD_RST pins can be defined as any other free GPIO. The LCD_CLK and LCD_SDI pins cannot be modified (they are defined by the system and do not need to be defined). -
STM32 test program GPIO definition description
The STM32’s LCD non-SPI GPIO definition is placed in lcd.h as shown below(Taking the STM32F103RCT6 software test program as an example):
All pin definitions can be modified and can be defined as any other free GPIO.
The GPIO definition of the STM32 LCD SPI is placed in spi.h as shown below(Taking the STM32F103RCT6 software test program as an example):
If the software SPI is used, all pin definitions can be modified and can be defined as any other free GPIO.
If the hardware SPI is used, these pins cannot be modified (it is defined by the system and need not be defined). At the same time, the SPI_SCLK, SPI_MISO and SPI_MOSI pins must be initialized and removed in the LCD_GPIOInit function in the lcd.c file, as shown in the figure below. (Taking the STM32F103RCT6 software test program as an example): The contents of the red circle must be removed.
SPI communication code implementation
-
Arduino test program SPI communication code implementation
Hardware SPI communication is implemented by the system. We only need to operate the register and call the relevant function. For details, please refer to the MCU related documentation.
The software SPI communication code is implemented in the LCDWIKI_SPI.cpp file of the LCDWIKI_SPI library, as shown below:
If the transmitted data bit is 1, the SPI data pin is pulled high. When it is 0, the SPI data pin is pulled low, one byte of data is transferred each time, the upper bit is first, and one bit of data is transmitted on each rising edge of the clock. -
STM32 test program SPI communication code implementation
Hardware SPI communication is implemented by the system. We only need to operate the register and call the relevant function. For details, please refer to the MCU related documentation.
The software SPI communication code is implemented in spi.c respectively, as shown in the following figure:
If the transmitted data bit is 1, the SPI data pin is pulled high. When it is 0, the SPI data pin is pulled low, one byte of data is transferred each time, the upper bit is first, and one bit of data is transmitted on each rising edge of the clock. -
C51 test program SPI communication code implementation
Hardware SPI communication is implemented by the system. We only need to operate the register and call the relevant function. For details, please refer to the MCU related documentation.
The software SPI communication code is implemented in lcd.c respectively, as shown in the following figure:
If the transmitted data bit is 1, the SPI data pin is pulled high. When it is 0, the SPI data pin is pulled low, one byte of data is transferred each time, the upper bit is first, and one bit of data is transmitted on each rising edge of the clock
Common software
This set of test examples requires the display of Chinese and English, symbols
and pictures, so the modulo software is used. There are two types of modulo
software: Image2Lcd and PCtoLCD2002. Here is only the setting of the modulo
software for the test program.
The PCtoLCD2002 modulo software settings are as follows:
- Dot matrix format select Dark code
- the modulo mode select the progressive mode
- Take the model to choose the direction (high position first)
- Output number system selects hexadecimal number
- Custom format selection C51 format
The specific setting method is as follows:
http://www.lcdwiki.com/Chinese_and_English_display_modulo_settings
Image2Lcd modulo software settings are shown below:
The Image2Lcd software needs to be set to horizontal, left to
right, top to bottom, and low position to the front scan mode.
www.surenoo.com
References
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>