MSP3520 3.5inch SPI Module
“
Specifications
- Name: Display Color
- SKU: CR2018-MI3128
- Screen Size Type: 3.5-inch TFT
- Driver IC: ILI9488
- Resolution: 480*320 (Pixel)
- Module Interface: 4-wire SPI interface
- Active Area: 48.96×73.44 (mm)
- Module PCB Size: 56.34×98 (mm)
- Angle of view:
Product Description
The LCD module uses a 4-wire SPI communication method with a
driver IC of ILI9488 with a resolution of 320×480 and a touch
function (optional). The module includes an LCD display, backlight
control circuitry, and touch screen control circuitry.
Product Features
- 3.5-inch color screen, support 16-bit 65K color display
- 480X320 resolution with optional touch function
- Using the SPI serial bus, it only takes a few IOs to illuminate
the display - Easy to expand the experiment with SD card slot
- Military-grade process standards, long-term stable work
- Provide underlying driver technical support
Product Parameters
- Operating Temperature: -20~70
- Storage Temperature: -30~80
- Operating Voltage: 3.3V / 5V
- Power Consumption: About 90mA
- Product Weight: About 45(g)
Interface Description
The interface includes pins for VCC, GND, CS, RESET, DC/RS,
SDI(MOSI), SCK, LED, and SDO(MISO) for various control and data
transfer functions.
Hardware Configuration
The hardware circuit includes LCD display control, touch screen
control (optional), and backlight control. Each part has specific
functions related to controlling the respective components.
Working Principle
The ILI9488 controller utilizes 18bit RGB666 to control pixel
display, capable of displaying up to 262K colors per pixel. Pixel
address settings are done in a specific order.
Product Usage Instructions
1. Connection
Connect the module pins according to the interface description
provided in the manual.
2. Power Supply
Ensure the module is powered with a stable voltage of either
3.3V or 5V as per the operating voltage specifications.
3. Display Control
Utilize the provided sample programs and underlying driver
technical support for controlling the LCD display.
4. Touch Function (if applicable)
If your module includes a touch function, follow the wiring
instructions for connecting the touch screen signal lines for
proper touch functionality.
5. Backlight Control
If you need to control the backlight, use the backlight control
circuit provided. If not required, connect the backlight pin to the
power supply directly.
Frequently Asked Questions (FAQ)
Q: Can I use this module without the touch function?
A: Yes, you can use the module without connecting the touch
screen signal lines if the touch function is not required.
Q: What is the power consumption of the module?
A: The module consumes about 90mA of power during operation.
“`
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
3.5inch SPI Module MSP3520 User Manual
1 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
Product Description
The LCD module uses a 4-wire SPI communication method with a driver IC of ILI9488 with a resolution of 320×480 and a touch function (optional). The module includes an LCD display, backlight control circuitry, and touch screen control circuitry.
Product Features
3.5-inch color screen,support 16-bit 65K color display,display rich colors 480X320 resolution with optional touch function Using the SPI serial bus, it only takes a few IOs to illuminate the display Easy to expand the experiment with SD card slot Provide a rich sample program Military-grade process standards, long-term stable work Provide underlying driver technical support
Product Parameters
Name Display Color
SKU
Screen Size Type
Driver IC Resolution Module Interface Active Area Module PCB Size Angle of view
Description RGB 65K color have touch screen: MSP3520 have no touch screen: MSP3521
3.5(inch) TFT
ILI9488 480*320 (Pixel) 4-wire SPI interface 48.96×73.44 (mm) 56.34×98 (mm)
>60°
2 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
Operating Temperature Storage Temperature Operating Voltage Power Consumption Product Weight
-20~70 -30~80
3.3V / 5V About 90mA About 45(g)
Interface Description
CR2018-MI3128
Pin silkscreen picture
Number 1 2 3 4 5 6 7
8 9
Module Pin VCC GND CS RESET
DC/RS SDI(MOSI)
SCK
LED SDO(MISO)
Pin Description
LCD power supply is positive (3.3V~5V) LCD Power ground LCD selection control signal LCD reset control signal LCD register / data selection control signal LCD SPI bus write data signal LCD SPI bus clock signal LCD backlight control signal (high level lighting, if you do not need control, please connect 3.3V) LCD SPI bus read data signal (can not be connected
3 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
if not needed) The following is the touch screen signal line wiring, if you do not need to touch function or the module itself does not have touch function, you can not connect them
10
T_CLK
Touch screen SPI bus clock pin
11
T_CS
Touch screen chip select control pin
12
T_DIN
Touch screen SPI bus write data pin
13
T_DO
Touch screen SPI bus read data pin
14
T_IRQ
Touch screen interrupt detection pin
Hardware Configuration
The LCD module hardware circuit includes three parts: an LCD display control circuit, a touch screen 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 touch screen control circuit can control touch screen touch corresponding and touch coordinate reading (touch screen optional).
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
1. Introduction to ILI9488 Controller
The ILI9488 controller supports a maximum resolution of 320*480 and a 345600-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 ILI9488 also supports 65K, 262K ,16.7M 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 ILI9488 controller uses 18bit (RGB666) to control a pixel display, so it can display up to 262K colors per pixel. The pixel address setting is performed in the order of
4 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
rows and columns, and the incrementing and decreasing direction is determined by the scanning mode. The ILI9488 display method is performed by setting the address and then setting the color value.
2. 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;
5 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
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
1. Arduino instructions
Wiring instructions:
Arduino UNO microcontroller test program wiring
Number
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Module Pin
SDO(MISO) LED SCK
SDI(MOSI) DC/RS RESET CS GND VCC T_IRQ T_DO T_DIN T_CS T_CLK
Corresponding to UNO development board wiring pins 12 A0 13 11 A3 A4 A5 GND 5V/3.3V 6 4 5 2 3
Arduino MEGA2560 microcontroller test program wiring
Number 1
Module Pin SDO(MISO)
Corresponding to MEGA2560 development board wiring pins
50
6 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
2
LED
3
SCK
4
SDI(MOSI)
5
DC/RS
6
RESET
7
CS
8
GND
9
VCC
10
T_IRQ
11
T_DO
12
T_DIN
13
T_CS
14
T_CLK
A0 52 51 A3 A4 A5 GND 5V/3.3V 49 47 48 45 46
Operating Steps A. 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 B. Connect the LCD module and the Arduino MCU according to the above wiring instructions, and power on; C. 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); D. 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)
7 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
E. 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
F. If the LCD module displays characters and graphics normally, the program runs
successfully
2. C51 instructions
Wiring instructions:
STC89C52RC and STC12C5A60S2 microcontroller test program wiring instructions
Number Module Pin
Corresponding to STC89/STC12 development board wiring pin
1
VCC
5V/3.3V
2
GND
GND
3
CS
P13
4
RESET
P33
5
DC/RS
P12
6
SDI(MOSI)
P15
7
SCK
P17
8
LED
P32
8 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
9
SDO(MISO)
P16
10
T_CLK
P36
11
T_CS
P37
12
T_DIN
P34
13
T_DO
P35
14
T_IRQ
P40
Operating Steps A. Connect the LCD module and the C51 MCU according to the above wiring instructions, and power on; B. 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)
C. 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
D. If the LCD module displays characters and graphics normally, the program runs successfully
3. STM32 instructions
Wiring instructions:
9 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
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 1
Module Pin VCC
Corresponding to MiniSTM32 development board wiring pin
5V/3.3V
2
GND
GND
3
CS
PB11
4
RESET
PB12
5
DC/RS
PB10
6
SDI(MOSI)
PB15
7
SCK
PB13
8
LED
PB9
9
SDO(MISO)
PB14
10
T_CLK
PC0
11
T_CS
PC13
12
T_DIN
PC3
13
T_DO
PC2
14
T_IRQ
PC10
STM32F103ZET6 microcontroller test program wiring instructions
Number
Module Pin
Corresponding to Elite STM32 development board wiring pin
1
VCC
5V/3.3V
2
GND
GND
10 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
3
CS
4
RESET
5
DC/RS
6
SDI(MOSI)
7
SCK
8
LED
9
SDO(MISO)
10
T_CLK
11
T_CS
12
T_DIN
13
T_DO
14
T_IRQ
PB11 PB12 PB10 PB15 PB13 PB9 PB14 PC0 PC13 PC3 PC2 PC10
STM32F407ZGT6 microcontroller test program wiring instructions
Number 1
Module Pin VCC
Corresponding to Explorer STM32F4 development board wiring pin 5V/3.3V
2
GND
GND
3
CS
PB15
4
RESET
PB12
5
DC/RS
PB14
6
SDI(MOSI)
PB5
7
SCK
PB3
8
LED
PB13
9
SDO(MISO)
PB4
10
T_CLK
PB0
11
T_CS
PC5
12
T_DIN
PF11
11 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
13
T_DO
PB2
14
T_IRQ
PB1
STM32F429IGT6 microcontroller test program wiring instructions
Number
Module Pin
Corresponding to Apollo STM32F4/F7 development board wiring pin
1
VCC
5V/3.3V
2
GND
GND
3
CS
PD11
4
RESET
PD12
5
DC/RS
PD5
6
SDI(MOSI)
PF9
7
SCK
PF7
8
LED
PD6
9
SDO(MISO)
PF8
10
T_CLK
PH6
11
T_CS
PI8
12
T_DIN
PI3
13
T_DO
PG3
14
T_IRQ
PH11
Operating Steps A. Connect the LCD module and the STM32 MCU according to the above wiring instructions, and power on; B. 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)
12 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
C. 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
D. If the LCD module displays characters and graphics normally, the program runs successfully
Software Description
1. Code Architecture
A. Arduino code architecture description The code architecture is shown below:
13 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
Sample code
LCDWIKI Library
Application
LCDWIKI_SPI Library
LCDWIKI_GUI Library
LCDWIKI_TOUCH Library
Example1
Example2
Arduino’s test program code consists of two parts: the LCDWIKI library and application code. The LCDWIKI library consists of three parts: the LCDWIKI_SPI library, the LCDWIKI_GUI library, and the LCDWIKI_TOUCH 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. LCDWIKI_TOUCH is the underlying library of touch screens, mainly responsible for touch interrupt detection, touch data sampling and AD conversion, and touch data transmission. The application uses the API provided by the LCDWIKI library to write some test examples to implement some aspects of the test function. B. C51 and STM32 code architecture description The code architecture is shown below:
14 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
Sample code
test code
GUI code
LCD code
main
Platform code
touch code
SPI code
Key code
led code
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; Touch screen related operations are included in the touch code; SPI initialization and configuration related operations are included in the SPI 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;
2. 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: A. display speed
The hardware SPI is significantly faster than the software SPI, which is determined by the hardware. B. 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),
15 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
other control pins should be defined by themselves, or any idle reference can be used. foot. C. 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.
3. GPIO definition description
A. Arduino test program GPIO definition description The LCD screen and touch screen GPIO definitions of the Arduino test program are placed separately in each application, which means that each application can flexibly define GPIO according to requirements. As shown below (take UNO software SPI test program as an example):
Note: The touch screen GPIO is defined using the touch test program. B. C51 test program GPIO definition description
The GPIO definition related to the LCD of the C51 is placed in the lcd.h file as shown below:
16 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
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 pin definitions can be modified and can be defined as any other free GPIO. LCD_CLK and LCD_SDI do not need to be defined. The touch screen related GPIO definition is placed in the touch.h file, as shown below (take the STC12C5A60S2 microcontroller test program as an example):
The GPIO definition of the touch screen can be modified and can be defined as any other free GPIO. If the microcontroller does not have a P4 GPIO group, penirq can be defined as other GPIOs. C. STM32 test program GPIO definition description The STM32 LCD screen non-SPI GPIO definition is placed in lcd.h, as shown below (take STM32F103RCT6 microcontroller test program as an example):
All pin definitions can be modified and can be defined as any other free GPIO.
17 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
The GPIO definition of the STM32 LCD SPI is placed in spi.h as shown below (take the STM32F103RCT6 microcontroller 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, these pins do not need to be defined. At the same time, the SCLK, MISO and MOSI pins need to be initialized and removed in the LCD_GPIOInit function in the lcd.c file, as shown in the following figure (take the STM32F103RCT6 microcontroller test program as an example):
The contents of the red circle must be removed. The GPIO definition related to the STM32 touch screen is placed in the touch.h file as shown below (take the STM32F103RCT6 microcontroller test program as an example):
Modify the value in the brackets, all pin definitions can be modified, can be defined as any other free GPIO.
18 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
4. SPI communication code implementation
A. 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. B. C51 and 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 lcd.c and spi.c respectively, and the software SPI implementation method is the same, as shown in the following figure:
19 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
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.
5. touch screen calibration instructions
A. Arduino test program touch screen calibration instructions Arduino touch screen calibration needs to run the touch_screen_calibration program first, and then calibrate according to the prompts. After the calibration is passed, the calibration parameters displayed on the screen need to be written into the cali_para.h file of the LCDWIKI_TOUCH library, as shown below:
B. C51 test program touch screen calibration instructions The C51 touch screen calibration needs to execute the Touch_Adjust test item (only available in the STC12C5A60S2 test program), as shown below:
20 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
After the touch calibration is passed, you need to save the calibration parameters displayed on the screen in the touch.c file, as shown below:
C. STM32 test program touch screen calibration instructions The STM32 touch screen calibration program automatically recognizes whether calibration is required or manually enters calibration by pressing a button. It is included in the touch screen test item. The calibration mark and calibration parameters are saved in the AT24C02 flash. If necessary, read from the flash. The calibration process is as shown below:
21 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
start touch test
Read the calibration flag from the AT24C02 flash
Is it calibrated?
Y Enter the touch test
program
N
Automatically enter
the calibration
procedure
Save calibration parameters to AT24C02 flash
Y Is the touch
accurate?
N
Press KEY0 to
Y
enter the
calibration
Continue calibration
N
Is the calibration acceptable?
22 / 23
Rev1.0
3.5inch SPI Module MSP3520 User Manual
CR2018-MI3128
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.
23 / 23
Rev1.0
Documents / Resources
![]() |
Elecrow MSP3520 3.5inch SPI Module [pdf] User Manual CR2018-MI3128, MSP3520, MSP3521, MSP3520 3.5inch SPI Module, MSP3520, 3.5inch SPI Module, SPI Module, Module |