StarFive VisionFive SPI Manuale utente

Using VisionFive SPI to
Support LCD Display
with Python
Application Note
Version: 1.1
Date: 2022/07/29
Doc ID: VisionFive-ANEN-013-1.1
StarFive

Legal Statements
Important legal notice before reading this documentation.
PROPRIETARY NOTICE
Copyright © Shanghai StarFive Technology Co., Ltd., 2018-2022. All rights reserved.
Information in this document is provided "as is," with all faults. Contents may be periodically
updated or revised due to the product development. Shanghai StarFive Technology Co.,
Ltd. (hereinafter "StarFive") reserves the right to make changes without further notice to any
products herein.
StarFive expressly disclaims all warranties, representations, and conditions of any kind,
whether express or implied, including, but not limited to, the implied warranties or conditions
of merchantability, fitness for a particular purpose and non-infringement.
StarFive does not assume any liability rising out of the application or use of any product
or circuit, and specifically disclaims any and all liability, including without limitation indirect,
incidental, special, exemplary, or consequential damages.
All material appearing in this document is protected by copyright and is the property of
StarFive. You may use this document or any part of the document for internal or educational
purposes only, provided you do not modify, edit or take out of context the information in
this document in any manner. Information contained in this document may be used, at your
sole risk, for any purposes. StarFive authorizes you to copy this document, provided that
you retain all copyright and other proprietary notices contained in the original materials on
any copies of the materials and that you comply strictly with these terms. This copyright
permission does not constitute an endorsement of the products or services.
Contact Us
Address: Room 502, Building 2, No. 61 Shengxia Rd., China (Shanghai) Pilot Free Trade
Zone, Shanghai, 201203, China
Website: http://www.starfivetech.com
Email: [email protected](sales) , [email protected](support)
ii
StarFive

Preface
About this guide and technical support information.
About this document
This application note provides steps to use VisionFive's SPI to make a 2.4inch LCD display
with specified pictures.
Revision History
Table 0-1 Revision History
Version Released Revision
V1.1 2022/07/29 Added "cd" in the codeblock
cd /usr/local/lib64/python3.9/site-packages
to make it a complete command.
Notes and notices
The following notes and notices might appear in this guide:
•Tip:
Suggests how to apply the information in a topic or step.
•Note:
Explains a special case or expands on an important point.
•Important:
Points out critical information concerning a topic or step.
•CAUTION:
Indicates that an action or step can cause loss of data, security problems, or
performance issues.
•Warning:
Indicates that an action or step can result in physical harm or cause damage
to hardware.
iii
StarFive

Contents
List of Tables...........................................................................................................................5
List of Figures.........................................................................................................................6
Legal Statements.................................................................................................................... ii
Preface....................................................................................................................................iii
1. Introduction....................................................................................................................... 7
1.1. 40-Pin Header Definition..........................................................................................7
2. Preparation........................................................................................................................ 8
2.1. Preparing Hardware................................................................................................. 8
2.1.1. Hardware Setup............................................................................................. 8
2.2. Preparing Software.................................................................................................10
3. Running Demo Code......................................................................................................12
4. Demo Source Code........................................................................................................ 15
www.starfivetech.com © 2018-2022 上海赛昉科技有限公司
版权所有
4
StarFive

目录
List of Tables
Table 0-1 Revision History..................................................................................................... iii
Table 2-1 Hardware Preparation............................................................................................ 8
Table 2-2 Connect the 2.4inch LCD to the 40-Pin Header.................................................... 9
5© 2018-2022 上海赛昉科技有限公司
版权所有
www.starfivetech.com
StarFive

目录
List of Figures
Figure 1-1 40-Pin Definition....................................................................................................7
Figure 2-1 Connect the 2.4inch LCD to the 40-Pin Header................................................. 10
Figure 3-1 Example Output.................................................................................................. 13
Figure 3-2 Example Output.................................................................................................. 13
www.starfivetech.com © 2018-2022 上海赛昉科技有限公司
版权所有
6
StarFive

1. Introduction
This application note provides steps to use VisionFive's SPI to make a 2.4inch LCD display
with specified pictures.
1.1. 40-Pin Header Definition
The following figure shows the location of the 40-pin header. The VisionFive board is taken
as an example:
Figure 1-1 40-Pin Definition
7© 2018-2022 上海赛昉科技有限公司
版权所有
www.starfivetech.com
StarFive

2. Preparation
Before executing the demo program, make sure you prepare the following:
2.1. Preparing Hardware
Prepare the following hardware items before running the demo code:
Table 2-1 Hardware Preparation
Type M/O*Item Notes
Gener
al
M StarFive single board computer The following boards are applica
ble:
•StarLight
•VisionFive
Gener
al
M•16 GB (or more) micro-SD
card
•micro-SD card reader
•Computer (Windows/MAC/
Linux)
•USB to serial converter (3.3
V I/O)
•Ethernet cable
•Power adapter (5 V / 3 A)
•USB Type-C Cable
These items are used for flashing
Fedora OS into a micro-SD card.
SPI
LCD
•2.4inch LCD Module
•Dupont Line
-
Note:
*: M: Mandatory, O: Optional
2.1.1. Hardware Setup
The following table and figure describe how to connect LCD to the 40-pin header:
www.starfivetech.com © 2018-2022 上海赛昉科技有限公司
版权所有
8
StarFive

| 2 - Preparation
Table 2-2 Connect the 2.4inch LCD to the 40-Pin Header
40-Pin GPIO Header
2.4inch LCD Module
Pin Number Pin Name
VCC 17 3.3V Power
GND 39 GND
DIN 19 GPIO18 (SPI MOSI)
CLK 23 GPIO12 (SPI SCLK)
CS 24 GPIO15 (SPI CE0)
DC 40 GPIO0
RST 11 GPIO44
BL 18 GPIO19
9© 2018-2022 上海赛昉科技有限公司
版权所有
www.starfivetech.com
StarFive

| 2 - Preparation
Figure 2-1 Connect the 2.4inch LCD to the 40-Pin Header
1
3
5
7
9
11
17
19
23
27
31
35
13
15
21
25
29
33
37
39
2
4
6
8
10
12
18
20
24
28
32
36
14
16
22
26
30
34
38
40
5VPower
5VPower
GND
GPIO14(UARTTX)
GPIO13(UARTRX)
GPIO45
GPIO19
GND
GPIO15(SPICE0)
GPIO10
GPIO7(PWM0)
GPIO4
GND
GPIO21
GPIO17
GPIO11(SPICE1)
GND
GND
GPIO2
GPIO0
3.3VPower
GPIO48(I2CSDA)
GPIO47(I2CSCL)
GPIO46
GND
GPIO44
3.3VPower
GPIO18(SPIMOSI)
GPIO12(SPISCLK)
GPIO9
GPIO6
GPIO3
GPIO22
GPIO20
GPIO16(SPIMISO)
GND
GPIO8
GPIO5(PWM1)
GPIO1
GND
VCC
GND
CLK
CS
BL
DC
RST
2.4inchLCDModule
DIN
2.2. Preparing Software
Make sure the following procedures are performed:
www.starfivetech.com © 2018-2022 上海赛昉科技有限公司
版权所有
10
StarFive
Indice
Altri manuali StarFive Hardware per computer
Manuali Hardware per computer popolari di altre marche

EMC2
EMC2 VNX Series Manuale del proprietario

Panasonic
Panasonic DV0PM20105 Manuale utente

Mitsubishi Electric
Mitsubishi Electric Q81BD-J61BT11 Manuale utente

Gigabyte
Gigabyte B660M DS3H AX DDR4 Manuale utente

Raidon
Raidon iT2300 Manuale utente

National Instruments
National Instruments PXI-8186 Manuale utente












