MSP2833/MSP2834 UNO/Mega2560 Demo Instructions
1. Introduction to Testing Platform
Development board: Arduino UNO/MEGA2560
MCU: AVR_ATmega328P/AVR_ATmega2560
Frequency: 16MHz/16MHz
2. Pin connection instructions
The display module is connected to the microcontroller using a DuPont cable, with specific instructions as follows:
Number | Module Pin | UNO development board wiring pin | Remarks |
---|---|---|---|
1 | VCC | 5V | LCD power positive |
2 | GND | GND | LCD Power ground |
3 | LCD_CS | 10 | LCD selection control signal, Low level active |
4 | LCD_RST | 8 | LCD reset control signal, Low level reset |
5 | LCD_RS | 9 | LCD command / data selection control signal. High level: data, low level: command |
6 | SDI(MOSI) | 11 | SPI bus write data signal(SD card and LCD screen used together) |
7 | SCK | 13 | SPI bus clock signal(SD card and LCD screen used together) |
8 | LED | 5 | 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) | 12 | SPI bus read data signal (SD card and LCD screen used together) |
10 | CTP_SCL | A5 | Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected) |
11 | CTP_RST | 6 | Capacitor touch screen reset control signal, low-level reset (modules without touch screens do not need to be connected) |
12 | CTP_SDA | A4 | Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected) |
13 | CTP_INT | 7 | 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 | 4 | SD card selection control signal, low level active (without SD card function, can be disconnected) |
Arduino MEGA2560 microcontroller test program wiring instructions
Number | Module Pin | Corresponding to MEGA2560 development board wiring pin | Remarks | |
---|---|---|---|---|
Hardware SPI | SoftWare SPI | |||
1 | VCC | 5V | LCD power positive | |
2 | GND | GND | LCD Power ground | |
3 | LCD_CS | 10 | LCD selection control signal, Low level active | |
4 | LCD_RST | 8 | LCD reset control signal, Low level reset | |
5 | LCD_RS | 9 | LCD command / data selection control signal. High level: data, low level: command | |
6 | SDI(MOSI) | 51 | 11 | SPI bus write data signal(SD card and LCD screen used together) |
7 | SCK | 52 | 13 | SPI bus clock signal(SD card and LCD screen used together) |
8 | LED | 5 | 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) | 50 | 12 | SPI bus read data signal (SD card and LCD screen used together) |
10 | CTP_SCL | A5 | Capacitive touch screen IIC bus clock signal (modules without touch screens do not need to be connected) | |
11 | CTP_RST | 6 | Capacitor touch screen reset control signal, low-level reset (modules without touch screens do not need to be connected) | |
12 | CTP_SDA | A4 | Capacitive touch screen IIC bus data signal (modules without touch screens do not need to be connected) | |
13 | CTP_INT | 7 | 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 | 4 | SD card selection control signal, low level active (without SD card function, can be disconnected) |
3. Demo Function Description
This testing program includes two MCU programs, Arduino UNO and Mega2560. Each MCU program includes software spi and hardware spi function programs, which are located in Demo_UNO_Mega2560 directory, as shown in the following figure:
The testing program includes the following test items:
- A. Example_01_ Simple_ Test: A screen swiping test that does not rely on the library.
- B. Example_02_ clear_ Screen: A simple screen brushing test that cycles the screen in the order of black, white, red, green, and blue colors.
- C. Example_03_ colligate_ Test: A comprehensive test that displays graphics, lines, and counts program runtime.
- D. Example_04_ display_ Graphics: A graphical display test that displays various graphics.
- E. Example_05_ display_ Scroll: A scrolling test that displays text scrolling.
- F. Example_06_ display_ String: A text display test that displays different sizes of Chinese and English.
- G. Example_07_read_ Piexl: Tests for reading specified pixel color values.
- H. Example_08_show_bmp_ Picture: A test for displaying BMP format images on SD cards.
- I. Example_09_switch_ Test: A switch touch test that triggers the switch by clicking.
- J. Example_10_display_ Phonecall: A touch test for telephone dialing, which simulates the dialing function through touch.
- K. Example_11_touch_ Pen: A touch stroke test that uses a pen to draw on the LCD screen.
- L. Example_12_ Show_ SDCardInfo: A test that displays the storage information of the SD card.
- M. SDCard Extend Example: An SD test example that comes with the software.
4. Demo Usage Instructions
Installing development tool software
Download the installation package from the Arduino official website.
Download address: https://www.arduino.cc/en/software
Download the corresponding installation package according to your PC system, as shown in the following figure (the version in the picture may not be the latest version, and the download interface may not be the latest):
The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. This software can be used with any Arduino board.
Refer to the Getting Started page for Installation instructions.
SOURCE CODE
Active development of the Arduino software is hosted by GitHub. See the instructions for building the code. Latest release source code archives are available here. The archives are PGP-signed so they can be verified using this gpg key.
After the download is completed, unzip and click Install.
Installing software library
After the development environment is set up, the software library used by the sample program needs to be copied to the project library directory so that the sample program can be called. The software library is located in the Demo_UNO_Mega2560\Install libraries directory, as shown in the following figure: Among them: The default path for the engineering library directory is C:\Users\Administrator\Documents\Arduino\libraries. You can also change the project library directory: open the Arduino IDE software, click File ->Preferences, and reset the Sketchbook location in the pop-up interface, as shown in the following figure: Copy the software library to the project library directory, as shown in the following figure: Select Mega2560: If the following prompt appears, it indicates that the program has been compiled and downloaded successfully, and has already been run:Compile and Run Programs