1.3inch LCD Module User Manual en
1.3inch LCD Module User Manual en
OVERVIEW
This is a general LCD display Module, IPS screen, 1.3inch diagonal, 240*240
Examples are provided for testing. Examples are compatible with Raspberry Pi
SPECIFICATION
Interface : SPI
Type : TFT
Dimension : 45 x 31(mm)
1 / 15
1.3inch LCD Module User Manual
PINOUT
PIN Description
VCC 3.3V/5V
GND Ground
DC Data/Command selection
RST Reset
BL Backlight
2 / 15
1.3inch LCD Module User Manual
目录
Overview ........................................................................................................................................................1
Specification ........................................................................................................................................1
Pinout .....................................................................................................................................................2
Hardware .......................................................................................................................................................5
Controller ..............................................................................................................................................5
Download .............................................................................................................................................7
Raspberry Pi .........................................................................................................................................8
STm32 ................................................................................................................................................. 13
3 / 15
1.3inch LCD Module User Manual
Arduino ............................................................................................................................................... 14
FAQ ...................................................................................................................................................... 15
4 / 15
1.3inch LCD Module User Manual
HARDWARE
CONTROLLER
ST7789VM is a controller for 240 x RGB x 320 LCD. Note that the resolution of this
ST7789VM supports RGB444, RGB565 and RGB666 three formats. This LCD
For most of the LCD controller, there are several interfaces for choosing, this
COMMUNICATION PROTOCOL
Note: It is not like the tradition SPI protocol, it only uses MOSI to send data from
master to slave for LCD display. For details please refer to Datasheet Page 105.
RESX: Reset, should be pull-down when power on, set to 1 other time.
5 / 15
1.3inch LCD Module User Manual
CSX: Slave chip select. The chip is enabled only CS is set Low
The SPI communication protocol of the data transmission uses control bits: clock
CPOL defines the level while synchronization clock is idle. If CPOL=0, then it is LOW.
CPHA defines at whish clock’s tick the data transmission starts. CPHL=0 – at the first
This combination of two bits provides 4 modes of SPI data transmission. The
According to the figure above, data transmitting begins at the first falling edge,
6 / 15
1.3inch LCD Module User Manual
DEMO CODES
DOWNLOAD
Visit Waveshare wiki and search for 1.3inch LCD Module. Download the demo code:
7 / 15
1.3inch LCD Module User Manual
RASPBERRY PI
COPY TO RASPBERRY PI
3. Power on your Raspberry Pi and open Terminal, you can find that the examples is
4. Copy the RaspberryPi folder to /home/pi and change its execute permission.
sudo cp -r /boot/RaspberryPi/ ./
LIBRARIES INSTALL
8 / 15
1.3inch LCD Module User Manual
Install BCM2835:
cd
cd bcm2835-1.xx
sudo ./configure
sudo make
cd
xx is the version of library. For example, if the library you download is bcm2835-1.52,
Install wiringPi:
Open Terminal
cd
cd wiringPi
9 / 15
1.3inch LCD Module User Manual
sudo ./build
cd
Open Terminal
cd
cd
HARDWARE CONNECTION
The color of cable provided may be different, please connect it according to the silk
screen printing.
10 / 15
1.3inch LCD Module User Manual
VCC 5V 5V
DIN 19 MOSI
CLK 23 SCLK
CS 24 CE0
DC 22 P25
RST 13 P27
BL 12 P18
RUNNING EXAMPLES
bcm2835 example:
cd bcm2835
sudo ./main
If you get error information that cannot find the file, please execute sudo make to
compile codes and try again. Press Ctrl and C to stop running
wiringpi example:
11 / 15
1.3inch LCD Module User Manual
cd wiringpi
sudo ./main
If you get error information that cannot find the file, please execute sudo make to
compile codes and try again. Press Ctrl and C to stop running
python example:
cd python
EXPECTED RESULT
1. Clear screen
3. Draw figures
12 / 15
1.3inch LCD Module User Manual
STM32
HARDWARE CONNECTION
VCC 5V
GND GND
DIN PA7
CLK PA5
CS PB6
DC PA8
RST PA9
BL PB0
EXPECTED RESULT
1. Clear screen
3. Draw figures
13 / 15
1.3inch LCD Module User Manual
ARDUINO
HARDWARE CONNECTION
VCC 5V
GND GND
CLK D13
DIN D11
CS D10
DC D7
RST D8
BL D9
EXPECTED RESULT
1. Clear screen
3. Display figures
14 / 15
1.3inch LCD Module User Manual
FAQ
b) Check if the BL pin work normally, if the pin has no output, please try to
If you run python or bcm2835 examples after wiringPi, the LCD may cannot work
-You can use the function Paint_SetRotate(Rotate) to rotate display. Rotate should
- For some of the OS, you should execute command to install python-imaging
15 / 15