LCDWIKI MSP4030 4.0 Inch Capacitive SPI Module Instructions

June 17, 2024
LCDWIKI

LCDWIKI-logo

LCDWIKI MSP4030 4.0 Inch Capacitive SPI Module

LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-product-
image

Product Information

Specifications

  • Development board: STM32F103C8T6, MiniSTM32, Elite STM32, Explorer STM32F4, Apollo STM32F4/F7
  • MCU: STM32F103C8T6, STM32F103RCT6, STM32F103ZET6, STM32F407ZGT6, STM32F429IGT6, STM32F767IGT6STM32H743IIT6
  • Frequency: 72MHz, 72MHz, 72MHz, 168MHz, 180MHz, 216MHz, 400MHz (Corresponding to the above MCU)

Pin Connection Instructions
This display module can be directly plugged into the STM32F103C8T6 development board and can only be connected to other development boards through DuPont cables.

Figure 1: Module Inline STM32F103C8T6 Development Board

Figure 2: Module Back Pins

STM32F103C8T6 Test Program Pin Direct Insertion Instructions

Number| Module pins| Corresponding STM32F103 development board wiring pins| Remarks
---|---|---|---
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PB9| LCD selection control signal, Low level active
4| LCD_RST| PB8| LCD reset control signal, Low level reset
5| LCD_RS| PB7| LCD command / data selection control signal, High level: data,
low level: command
6| SDI(MOSI)| PA7| SPI bus write data signal (SD card and LCD screen used
together)
7| SCK| PA5| SPI bus clock signal (SD card and LCD screen used
together)
8| LED| PB6| LCD backlight control signal (If you need control, please
connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PA6| SPI bus read data signal (SD card and LCD screen used
together)

STM32F103RCT6 microcontroller test program wiring instructions (Corresponding to MiniSTM32)

Number Module Pin development board wiring pin Remarks
1 VCC 5V LCD power positive
2 GND GND LCD Power ground
3 LCD_CS PB11 LCD selection control signal, Low level active
4 LCD_RST PB12 LCD reset control signal, Low level reset
5 LCD_RS PB10 LCD command / data selection control signal, High level:

data,
low level: command
6| SDI(MOSI)| PB15| SPI bus write data signal (SD card and LCD screen used
together)
7| SCK| PB13| SPI bus clock signal (SD card and LCD screen used
together)
8| LED| PB9| LCD backlight control signal (If you need control, please
connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PB14| SPI bus read data signal (SD card and LCD screen used
together)

STM32F103ZET6 microcontroller test program wiring instructions (Corresponding to Elite STM32)

Number Module Pin development board wiring pin Remarks
1 VCC 5V LCD power positive
2 GND GND LCD Power ground
3 LCD_CS PB11 LCD selection control signal, Low level active
4 LCD_RST PB12 LCD reset control signal, Low level reset
5 LCD_RS PB10 LCD command / data selection control signal, High level:

data,
low level: command
6| SDI(MOSI)| PB15| SPI bus write data signal (SD card and LCD screen used
together)
7| SCK| PB13| SPI bus clock signal (SD card and LCD screen used
together)
8| LED| PB9| LCD backlight control signal (If you need control, please
connect the pins. If you don’t need control, you can skip it)

FAQ

  • Q: Can I directly plug the display module into the MiniSTM32 development board?
    A: No, the display module can only be directly plugged into the STM32F103C8T6 development board. For other development boards, you need to connect them using DuPont cables.

  • Q: How do I control the LCD backlight?
    A: If you need to control the LCD backlight, please connect the LED pin. If you don’t need control, you can skip it.

  • Q: What is the frequency range supported by the MCU?
    A: The supported frequency range for the MCU varies depending on the model. Please refer to the specifications section for the corresponding frequencies.

MSP4030_MSP4031 STM32 Demo Instructions CR2023-MI4037

Introduction to Testing Platform

  • Development board: STM32F103C8T6, MiniSTM32, Elite STM32, Explorer STM32F4, Apollo STM32F4/F7
  • MCU: STM32F103C8T6, STM32F103RCT6, STM32F103ZET6, STM32F407ZGT6, STM32F429IGT6, STM32F767IGT6、STM32H743IIT6
  • Frequency: 72MHz、72MHz、72MHz、168MHz、180MHz、216MHz、400MHz (Corresponding to the above MCU)

Pin connection instructions

This display module can be directly plugged into the STM32F103C8T6 development board, and can only be connected to other development boards through DuPont cables. LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01
\(1\) Figure 1: Module Inline STM32F103C8T6 Development Board

LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01
\(2\)

STM32F103C8T6 Test Program Pin Direct Insertion Instructions

Number| Module pins| Corresponding STM32F103 development board wiring pins| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PB9| LCD selection control signal, Low level

active

4| LCD_RST| PB8| LCD reset control signal, Low level reset
5| LCD_RS| PB7|

  • LCD command / data selection control signal
  • High level: data, low level: command

6| SDI(MOSI)| PA7| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PA5| SPI bus clock signal(SD card and LCD screen used together)
8| LED| PB6| LCD backlight control signal (If you need control, please connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PA6| SPI bus read data signal (SD card and LCD screen used together)
10| CTP_SCL| PB5| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
---|---|---|---
11| CTP_RST| PA10| Capacitor touch screen reset control signal, low- level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PA9| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| CTP_INT| PA8| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)
STM32F103RCT6 microcontroller test program wiring instructions

Number| Module Pin| Corresponding to MiniSTM32 development board wiring pin| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PB11| LCD selection control signal, Low level active
4| LCD_RST| PB12| LCD reset control signal, Low level reset
5| LCD_RS| PB10| LCD command / data selection control signal High level: data, low level: command
6| SDI(MOSI)| PB15| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PB13| SPI bus clock signal(SD card and LCD screen used together)
8| LED| PB9| LCD backlight control signal (If you need control, please connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PB14| SPI bus read data signal (SD card and
| | | LCD screen used together)
---|---|---|---
10| CTP_SCL| PC0| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
11| CTP_RST| PC13| Capacitor touch screen reset control signal, low- level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PC3| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| CTP_INT| PC10| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)
STM32F103ZET6 microcontroller test program wiring instructions

Number| Module Pin| Corresponding to Elite STM32 development board

wiring pin

| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PB11| LCD selection control signal, Low level active
4| LCD_RST| PB12| LCD reset control signal, Low level reset
5| LCD_RS| PB10| LCD command / data selection control signal High level: data, low level: command
6| SDI(MOSI)| PB15| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PB13| SPI bus clock signal(SD card and LCD screen used together)
8| LED| PB9| LCD backlight control signal (If you need control, please connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PB14| SPI bus read data signal (SD card and LCD screen used together)
---|---|---|---
10| CTP_SCL| PC0| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
11| CTP_RST| PC13| Capacitor touch screen reset control signal, low- level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PC3| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| CTP_INT| PC10| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)
STM32F407ZGT6 microcontroller test program wiring instructions

Number| Module Pin| Corresponding to Explorer STM32F4 development board

wiring pin

| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PB15| LCD selection control signal, Low level active
4| LCD_RST| PB12| LCD reset control signal, Low level reset
5| LCD_RS| PB14| LCD command / data selection control signal High level: data, low level: command
6| SDI(MOSI)| PB5| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PB3| SPI bus clock signal(SD card and LCD screen used together)
8| LED| PB13| LCD backlight control signal (If you need
| | | control, please connect the pins. If you don’t need control, you can skip it)
---|---|---|---
9| SDO(MISO)| PB4| SPI bus read data signal (SD card and LCD screen used together)
10| CTP_SCL| PB0| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
11| CTP_RST| PC5| Capacitor touch screen reset control signal, low-level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PF11| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| CTP_INT| PB1| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)
STM32F429IGT6 microcontroller test program wiring instructions

Number| Module Pin| Corresponding to Apollo STM32F4/F7 development board wiring pin| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PD11| LCD selection control signal, Low level active
4| LCD_RST| PD12| LCD reset control signal, Low level reset
5| LCD_RS| PD5| LCD command / data selection control signal High level: data, low level: command
6| SDI(MOSI)| PF9| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PF7| SPI bus clock signal(SD card and LCD screen used together)
8| LED| PD6| LCD backlight control signal (If you need control, please connect the pins. If you don’t need control, you can skip it)
---|---|---|---
9| SDO(MISO)| PF8| SPI bus read data signal (SD card and LCD screen used together)
10| CTP_SCL| ****

PH6

| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
11| CTP_RST| PI8| Capacitor touch screen reset control signal, low-level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PI3| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| ****

CTP_INT

| PH11| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)
STM32F767IGT6,STM32H743IIT6 microcontroller test program wiring instructions

Number| Module Pin| Corresponding to Apollo STM32F4/F7 development board wiring pin| Remarks
1| VCC| 5V| LCD power positive
2| GND| GND| LCD Power ground
3| LCD_CS| PD11| LCD selection control signal, Low level active
4| LCD_RST| PD12| LCD reset control signal, Low level reset
5| LCD_RS| PD5| LCD command / data selection control signal High level: data, low level: command
6| SDI(MOSI)| PB15| SPI bus write data signal(SD card and LCD screen used together)
7| SCK| PB13| SPI bus clock signal(SD card and LCD
| | | screen used together)
---|---|---|---
8| LED| PD6| LCD backlight control signal (If you need control, please connect the pins. If you don’t need control, you can skip it)
9| SDO(MISO)| PB14| SPI bus read data signal (SD card and LCD screen used together)
10| CTP_SCL| PH6| Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected)
11| CTP_RST| PI8| Capacitor touch screen reset control signal, low-level reset (modules without touch screens do not need to be connected)
12| CTP_SDA| PI3| Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected)
13| CTP_INT| PH11| Capacitor touch screen IIC bus touch interrupt signal, when generating touch, input low level to the main control (modules without touch screens do not need to be connected)
14| SD_CS| NC| SD card selection control signal, low level active (without SD card function, can be disconnected)

Demo Function Description

This testing program includes 7 MCU testing programs including STM32F103C8T6, STM32F103RCT6, STM32F103ZET6, STM32F407ZGT6, STM32F429IGT6, STM32F767IGT6, STM32H743IIT6. Each MCU testing program includes two functions: software SPI and hardware SPI, which are located in Demo_STM32 directory, as shown in the following figure: LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01
\(1\)Description of sample program content

  • A. Main interface display;
  • B. Read the display screen ID and GRAM color values;
  • C. Simple screen swiping;
  • D. Drawing and filling of rectangles;
  • E. Draw and fill a circle;
  • F. Triangle drawing and filling;
  • G. English display;
  • H. Chinese display;
  • I. Image display;
  • J. Dynamic digital display;
  • K. Rotating display;
  • L. Capacitive touch screen (including touch buttons and handwritten lines);

Example program display direction switching instructions
Found macro definition USE_HORIZONTAL in LCD. h, as shown in the following:

  • USE_HORIZONTAL 0 //0°rotate
  • USE_HORIZONTAL 1 //90°rotate
  • USE_HORIZONTAL 2 //180°rotate
  • USE_HORIZONTAL 3 //270°rotate

Demo Usage Instructions

  • Installing development tool software
    Firstly, you need to install the development tool software, which uses Keil5. Please refer to the online download and installation methods for yourself.

  • Installing Device Library
    After the successful installation of the tool software, it is necessary to install several MCU device libraries, otherwise the project cannot be established, and compilation and download cannot be carried out. Please consult online for the installation method of the device library.

  • Compiling Programs
    After the library installation is completed, open the PROJECT directory under the sample program, locate the uvprojx file, double-click to open the sample project, as shown in the following figure: LCDWIKI-MSP4030-4-0-Inch-
Capacitive-SPI-Module-01 \(2\)

  • After opening the sample project, you can make modifications to the project code (or not). After the modifications are completed, click the compile button to compile the code. The following prompt appears, indicating successful compilation, as shown in the following figure: LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(3\)

Download and Run Programs

  • The development board supports SWD download and Jlink download
  • Here is an introduction to Jlink download. For other download methods, please refer to the documentation in the development board documentation package or consult the internet.
  • The steps for downloading Jlink are as follows (using the STM32F103RCT6 development board as an example):
  1. A. After the program compilation is completed, proceed with the program download.
    First, connect JTAG to the computer and development board, click on the magic wand icon ->Debug ->drop-down menu, and select J-LINK/J-TRACE Cortex, as shown in the following figure:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01
\(4\)

  2. B. Click on Settings again, set ort to SW and Max to 2MHz, as shown in the following:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(5\)

  3. C. Select the microcontroller model, click on the magic wand icon ->Device ->select the STM32F103RC microcontroller model, as shown in the following figure:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(6\)

  4. D. Select the flash model (if selected, please ignore it), click Utilities>Settings>Add>select STM32F10x High density Flash ->Add, as shown in the following figure:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(7\)

  5. E. After setting up both JTAG and flash, the program can be downloaded. Download the program, click the download button, and download the hex file to the development board. If the prompt “Programming Done. Verify OK.” appears, it indicates successful download, as shown in the following figure:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(8\)

  6. F. After the program is successfully downloaded, if the module does not respond, you need to press the reset button or power off and restart to run normally. If you want the program to automatically run after successful download, you need to press the following settings:

  7. Click on the magic wand icon ->Utilities ->Settings ->check Reset and run, as shown in the following figure:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(9\)

  8. G. If the display module displays characters and graphics normally, it indicates that the program has run successfully.

NOTE:

  1. A. When downloading the program, if the following error occurs, it indicates that the JTAG setting is incorrect. Please follow step B to set it:LCDWIKI-MSP4030-4-0-Inch-Capacitive-SPI-Module-01 \(3\)
  2. B. If the following error occurs, it indicates that the flash setting is incorrect. Please follow step D to set it:

www.lcdwiki.com

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals