LCDWIKI MSP4030 4.0inch Capacitive SPI Module User Manual
- June 16, 2024
- LCDWIKI
Table of Contents
MSP4030_MSP403
1 C51 Demo Instructions
Introduction to Testing Platform
Development board: STC89/STC12 development board
MCU: STC89C52RCSTC12C5A60S2
Frequency : 11.0592MHZ
Pin connection instructions
The display module is connected to the microcontroller using a DuPont cable,
with specific instructions as follows:
Picture1. Module Back Pins
STC89C52RC and STC12C5A60S2 microcontroller test program wiring instructions
Number| Module Pin| STC89/STC12 Development
Board Wiring Pin| Remarks
---|---|---|---
1| VCC| 5V| LCD power positive
2| GND| GND| LCD power ground
3| LCD_CS| P13| LCD selection control signal, Low P13 level active
4| LCD_RST| P33| LCD reset control signal, Low P33 level reset
5| LCD_RS| P12| High level: data, low level: command
6| SDI(MOSI)| P15| SPI bus write data signal (SD card and LCD screen used
together)
7| SCK| P17| SPI bus clock signal (SD card and LCD screen used
together)
8| LED| P32| LCD backlight control signal (optional)
9| SDO(MISO)| P16| SPI bus read data signal (SD card and LCD screen used
together)
10| CTP_SCL| P36| Capacitive touch screen IIC bus clock signal (optional)
11| CTP_RST| P37| Capacitive touch screen reset control signal (optional)
12| CTP_SDA| P34| Capacitive touch screen IIC bus data signal (optional)
13| CTP_INT| P35| Capacitive touch screen touch interrupt signal (optional)
14| SD_CS| NC| SD card selection control signal (optional)
Demo Function Description
This testing program includes two types of MCU programs: STC89C52RC and
STC12C5A60S2. STC12C5A60S2 includes software SPI and hardware SPI programs,
while STC89C52RC only has software SPI programs, which are located in
Demo_ Under the C51 directory, as shown in the following figure:
Description of sample program content
The ROM of the STC89C52RC microcontroller is only 25KB and cannot store overly
complex and large programs, so only simple screen swiping tests are performed;
STC12C5A60S2 microcontroller test program contains the following test items:
A. The main interface displays the test;
B. Display screen ID and GRAM color value reading test (only software SPI is
supported, and there are exceptions when hardware SPI reads ID);
C. simple brush test;
D. rectangular drawing and filling test;
E. circular drawing and filling test;
F. triangle drawing and filling test;
G. English display test;
H. Chinese display test;
I. picture display test;
J. Dynamic digital display test
K. rotating display test;
L. Capacitive touch screen testing (including touch button testing and
handwriting line testing)
Display direction switching instructions:
Find the macro definition USE_HORIZONTAL in lcd.h as shown below:
Demo Usage Instructions
Installing development tool software
Firstly, you need to install the development tool software. Keil5 and stc-isp
software are used here, where Keil5 is used for code editing and compilation,
and stc-isp is used for download. Please refer to the online download and
installation methods for both software.
Installing chip packages
After installing keil5, it is necessary to install the C51 chip package,
otherwise the C51 chip cannot be found and the C51 project cannot be
created.Please consult online for specific installation methods.
Compiling Programs
After the development tool and chip package are successfully installed, 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:
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:
Download and Run Programs
A. Open the STC-ISP software for program download, first select the correct
microcontroller model and baud rate, and set them as shown in the following
figure:B. Click to open the program file ->select
the directory where the compiled hex file is located ->select the hex file
->click the open button, as shown in the following figure:
C. Click the download button to power on
the microcontroller again, and the program will be burned. When the “Operation
successful” prompt appears, it indicates successful burning. The operation is
shown in the following figure:
D. If the display module displays
characters and graphics normally, it indicates that the program has run
successfully.
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>