Difference between revisions of "Matrix - 2'8 SPI Key TFT"

From FriendlyELEC WiKi
Jump to: navigation, search
(Features)
(Applications)
Line 139: Line 139:
  
 
==Applications==
 
==Applications==
===Connect to NanoPi M1===
+
===H3 Based Boards===
 +
Connect to NanoPi M1:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M1:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M1:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m1.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m1]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m1.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m1]]
  
===Connect to NanoPi M1 Plus===
+
Connect to NanoPi M1 Plus:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M1 Plus:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M1 Plus:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m1_plus.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m1_plus]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m1_plus.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m1_plus]]
  
===Connect to NanoPi NEO===
+
Connect to NanoPi NEO:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi NEO:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi NEO:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo]]
  
===Connect to NanoPi NEO Air===
+
Connect to NanoPi NEO Air:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi NEO Air:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi NEO Air:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo_air.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo_air]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo_air.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo_air]]
  
===Connect to NanoPi 2===
+
===H5 Based Boards===
 +
Connect to NanoPi NEO2:<br>
 +
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo2]]<br>
 +
 
 +
Connect to NanoPi NEOPlus2:<br>
 +
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_neo_plus2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_neo_plus2]]<br>
 +
 
 +
===S5P4418 Based Boards===
 +
Connect to NanoPi 2:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi 2:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi 2:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi2]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi2]]
  
===Connect to NanoPi M2 / NanoPi 2 Fire===
+
Connect to NanoPi M2 / NanoPi 2 Fire:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M2 / NanoPi 2 Fire:<br>
 
Refer to the following hardware setup to connect the module to the NanoPi M2 / NanoPi 2 Fire:<br>
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m2]]
 
[[File:Matrix-2'8_SPI_Key_TFT_nanopi_m2.jpg|frameless|600px|Matrix-2'8_SPI_Key_TFT_nanopi_m2]]

Revision as of 07:43, 5 July 2017

查看中文

1 Introduction

Matrix-2'8 SPI Key TFT.png
  • The Matrix-2.8_SPI_Key_TFT LCD is a FriendlyARM developed LCD module with resistive touch panel. Its resolution is 240 x 320. It uses the ST7789S IC and XPT2046 resistive touch IC. It has SPI interface and three configurable user keys.
  • Specification
LCD Dimension 2.8"
Display Area 57.6mm*43.2mm
Driver IC ST7789S
Resolution 240 * 320(RGB)
MCU Interface SPI
Power Supply 5V
Backlight Voltage 5V
Touch Resistive Touch, tempered glass touch panel

By default the module's backlight is turned on after the module is powered on. LED_EN can be set to turn off the backlight. If you don’t want the backlight to be turned on after the module is powered on you can take off R12 and in this case you can turn on the backlight by pulling up LED_EN.

2 Features

  • PCB dimension(mm):

Matrix-2'8 SPI Key TFT PCB.png

  • Pin Description:

FriendlyElec has released two versions. Here are the spec:

Matrix-2'8_SPI_Key_TFT-1512
Pin# Description Pin# Description
1 VDD_3.3V 2 VDD_5V
3 NC 4 VDD_5V
5 NC 6 GND
7 LCD_RESET 8 NC
9 GND 10 NC
11 LED_EN 12 NC
13 KEY_1 14 GND
15 KEY_2 16 KEY_3
17 VDD_3.3V 18 T_IRQ
19 SPI_MOSI 20 GND
21 SPI_MISO 22 LCD_D/C
23 SPI_CLK 24 LCD_CS
25 GND 26 T_CS
Matrix-2'8_SPI_Key_TFT-1706
Pin# Description Pin# Description
1 VDD_3.3V 2 VDD_5V
3 NC 4 VDD_5V
5 NC 6 GND
7 LCD_RESET 8 NC
9 GND 10 NC
11 LED_EN 12 T_CS
13 KEY_1 14 GND
15 KEY_2 16 KEY_3
17 VDD_3.3V 18 T_IRQ
19 SPI_MOSI 20 GND
21 SPI_MISO 22 LCD_D/C
23 SPI_CLK 24 LCD_CS
25 GND 26 NC

The Matrix-2'8_SPI_Key_TFT-1706 exposes T_CS from Pin26 to Pin12. And NEO/NEO2/NEO-Plus2 all of which have a 24Pin connector will be able to work with its touch.

3 Applicable Boards & OS

Index SoC Model Board Model OS
1 H3 NanoPi NEO/NEO Air/M1/M1 Plus Allwinner's released Linux-3.4 kernel and Mainline Linux-4.x kernel
2 H5 NanoPi NEO2/NEO Plus2 Mainline Linux-4.x kernel
3 S5P4418 NanoPi2/NanoPi M2/NanoPi2 Fire Samsung's released Linux-3.4 kernel

4 Applications

4.1 H3 Based Boards

Connect to NanoPi M1:
Refer to the following hardware setup to connect the module to the NanoPi M1:
Matrix-2'8_SPI_Key_TFT_nanopi_m1

Connect to NanoPi M1 Plus:
Refer to the following hardware setup to connect the module to the NanoPi M1 Plus:
Matrix-2'8_SPI_Key_TFT_nanopi_m1_plus

Connect to NanoPi NEO:
Refer to the following hardware setup to connect the module to the NanoPi NEO:
Matrix-2'8_SPI_Key_TFT_nanopi_neo

Connect to NanoPi NEO Air:
Refer to the following hardware setup to connect the module to the NanoPi NEO Air:
Matrix-2'8_SPI_Key_TFT_nanopi_neo_air

4.2 H5 Based Boards

Connect to NanoPi NEO2:
Matrix-2'8_SPI_Key_TFT_nanopi_neo2

Connect to NanoPi NEOPlus2:
Matrix-2'8_SPI_Key_TFT_nanopi_neo_plus2

4.3 S5P4418 Based Boards

Connect to NanoPi 2:
Refer to the following hardware setup to connect the module to the NanoPi 2:
Matrix-2'8_SPI_Key_TFT_nanopi2

Connect to NanoPi M2 / NanoPi 2 Fire:
Refer to the following hardware setup to connect the module to the NanoPi M2 / NanoPi 2 Fire:
Matrix-2'8_SPI_Key_TFT_nanopi_m2

5 Compile & Run Test Program

5.1 Run Qt Programs on Ubuntu-Core

FriendlyElec's Ubuntu-Core supports Qt. Users can run a Qt application by following the steps below.
Boot Ubuntu-Core on a board and clone the Matrix code samples:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

After it is done a "matrix" directory will be generated.

Compile and Run Qt Test Program:

cd matrix/demo/nanopi-status
./build.sh
./run.sh /dev/fb-st7789s

The nanopi-status is a simple Qt program which shows system information. Here is what you expect to observe:
st7789s-status

5.2 Display Debian GUI on 2.8"LCD

Boot your ARM board with Debian and and launch the Debian GUI by running the following commands:
After Debian is loaded clone the matrix code samples:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

After it is done a "matrix" directory will be generated.

For H3 based boards you need to change the X11 configuration file as follows:

$ vi /etc/X11/xorg.conf

Change "/dev/fb0" to "/dev/fb-st7789s".

Launch the Debian GUI by running the following commands:

$ cd matrix/demo/nanopi-status/
$ ./display-debian.sh /dev/fb-st7789s

Calibrate the screen by following the four points' movement:
fbtft-debian

After calibration is done you will see the following system information:

Section "InputClass" 
        Identifier      "calibration" 
        MatchProduct    "ADS7846 Touchscreen" 
        Option  "Calibration"   "196 3825 3887 358" 
        Option  "SwapAxes"      "0" 
EndSection

Copy and paste the information to the "/usr/share/X11/xorg.conf.d/99-calibration.conf" file, save it and this will be used as your calibration data when you reboot your board.

6 Resources

7 Update Log

7.1 Feb-24-2016

  • Added the driver's source code location in Section 5.2

7.2 June-17-2016

  • Re-organized and simplified wiki

7.3 March-5-2017

  • Added sections 3.2, 3.3, 3.4 and 4.1