Difference between revisions of "2.8inch TFT Touch Shield"

From Waveshare Wiki
Jump to: navigation, search
m (Text replace - ".htm More]" to ".htm More]}}")
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Modules]][[Category:GPS/GSM| ]][[Category:Arduino| ]]
+
{{Infobox item|colorscheme=blue
[[http://www.waveshare.net/wiki/2.8inch_TFT_Touch_Shield 中文]]
+
|name=2.8inch TFT Touch Shield
 
+
|brief=2.8 inch Arduino Touch LCD Shield
==Resources==
+
|img=[[File:2.8inch-TFT-Touch-Shield_l.jpg|250px|link=http://www.waveshare.com/2.8inch-TFT-Touch-Shield.htm]]
 
+
|caption=2.8 inch Arduino Touch LCD Shield
<div class="thumb tright">
+
|platform=Arduino
<div class="thumbinner" style="width:302px;">
+
|category=[[:Category:Arduino|Arduino]], [[:Category:Shields|Shields]], [[:Category:Modules|Moduiles]], [[:Category:LCD|LCD]]
<div class="Scaling">
+
|brand=Waveshare
<htmltag tagname="a" href="http://www.waveshare.com/product/arduino/shields/2.8inch-tft-touch-shield.htm" target="_blank" title="Introduction">
+
|{{#urlget:amazon|default}}=display
<htmltag tagname="img" alt="2.8inch TFT Touch Shield" src="http://www.waveshare.com/img/preview/2.8inch-tft-touch-shield_L.jpg" width="300" height="225" class="thumbimage">
+
|website_cn=[http://www.waveshare.net/shop/2.8inch-TFT-Touch-Shield.htm 官方中文站点]
</htmltag>
+
|website_en=[http://www.waveshare.com/2.8inch-TFT-Touch-Shield.htm Waveshare website]
</div>
+
|interface1=Arduino
<div class="thumbcaption">
+
|interface2=SPI
<div class="magnify">
+
|related=
<htmltag tagname="a" href="http://www.waveshare.com/img/preview/2.8inch-tft-touch-shield_L.jpg" target="_blank" class="internal" title="Full View">
+
{{Product List|Arduino Compatible/Shields / Adapters/WAVESHARE}}
<htmltag tagname="img" src="/wiki/skins/common/images/magnify-clip.png" width="15" height="11" alt="">
+
}}
</htmltag>
+
== Introduction ==
</div>2.8inch TFT Touch Shield</div>
+
2.8 inch Arduino Touch LCD Shield
</div>
 
</div>
 
 
 
*[http://www.waveshare.com/product/arduino/shields/2.8inch-tft-touch-shield.htm Introduction]
 
*[[http://www.waveshare.com/w/upload/8/84/2.8inch-TFT-Touch-Shield-UserManual-EN.pdf User Manual]]
 
*[http://www.waveshare.com/w/upload/c/c2/GSM-GPRS-GPS_Shield-Blue.pdf Schematic]
 
*[http://www.waveshare.com/w/upload/6/63/Phone-Shield-SIM908-Code.7z Code]
 
*[[Phone-Shield-SIM908_Datasheets|Datasheets]]
 
*[[Phone-Shield-SIM908_Software|Software]]
 
  
 +
{{Amazon|{{#urlget:amazon|default}}=display
 +
|More = [http://www.waveshare.com/2.8inch-TFT-Touch-Shield.htm More]}}
 +
{{2.8inch TFT Touch Shield User Manual}}
 +
== Resources ==
 +
*[http://www.waveshare.com/w/upload/8/84/2.8inch-TFT-Touch-Shield-UserManual-EN.pdf User Manual]
 +
*[http://www.waveshare.com/w/upload/d/d4/2.8inch_TFT_Touch_Shield_Schematic.pdf Schematic]
 +
*[http://www.waveshare.com/wiki/File:2.8inch_TFT_Touch_Shield_code.7z Source code]
 +
{{2.8inch TFT Touch Shield Datasheets}}
 
==FAQ==
 
==FAQ==
[[Category:Modules]][[Category:LCD| ]][[Category:Arduino| ]]
+
[[Category:Modules]][[Category:LCD]][[Category:Arduino]][[Category:Shields]]
 
==Support==
 
==Support==
 
{{Service00}}
 
{{Service00}}

Revision as of 06:26, 3 November 2016

2.8inch TFT Touch Shield
2.8 inch Arduino Touch LCD Shield
2.8inch-TFT-Touch-Shield l.jpg

2.8 inch Arduino Touch LCD Shield
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

2.8 inch Arduino Touch LCD Shield

More

Features

Driver chip ST7789V
Interface SPI
Resolution 320 *240
Display size 57.6mm*43.2mm
Outline dimension 73.3mm*55.3mm
Color RGB ,262K
Touch method Four-wire resistive

Applications

Digital photo frames, drawing boards, e-books, MP3 players, etc.

Interfaces

Symbol Descriptions
SCLK SPI clock
MISO SPI master in slave out
MOSI SPI master out slave in
LCD_CS LCD chip select signal
LCD_BL LCD backlight control signal
LCD_DC LCD digital command signal
SD_CS SD chip select signal
TP_CS XPT2046 chip select signal
TP_IRQ XPT2046 interrupt output signal
5V 5V power supply
GND Ground

Arduino

This demo has been tested on Arduino uno, just insert it into Arduino uno as shown below

How to Insert

Connect-shield.png

Hardware configuration

  • When using the Arduino board with ICSP interface, the jumpers SB1, SB2, and SB3 on the LCD module should be kept open.
  • When using the Arduino board without an ICSP interface, the jumpers SB1, SB2, and SB3 on the module should be connected with a 0R resistor, respectively.

Install Software (Windows)

Run the Program

Copy the files in the 2.8inch_TFT_Touch_Shield/Arduino/lib path in the example to the \Arduino\libraries directory of Arduino.
Program-tft.png
Open the program in the "examples" file, such as DisplayString.ino, and then select the development board model as Arduino UNO.
Program-tft2.png
Select the corresponding COM port.
UGV1 doenload03EN.png
Then click to compile and download.
Program-tft4.png

Demos

The four sample codes: DisplayString, DrawGraphic, ShowBMP, and TouchPanel are used to display strings, graphics, pictures in BMP format, and touch pen functions.

Before performing the ShowImage display picture experiment, first, copy the pictures in the PIC folder in the data to the root directory of the SD card (You should understand the root directory, that is to save the pictures directly to the SD card, do not put them in any subfolders).

Then insert the SD card into the card slot on the back of the screen to start the download program and verify.

Before experimenting with the TouchPanel, the touchscreen must be calibrated according to the displayed prompts. Open the corresponding project, burn the program, and you will be prompted when running:

Please use the stylus to click the cross on the screen. The cross will always move until the screen adjustment is completed.

As prompted, tap the red + sign on the screen until the calibration is complete.
Click CLEAR in the upper right corner of the LCD to clear the display
The functions of the touch screen are all in Touch.cpp:

  • Calibrate touch screen
tp_adjust()
  • Clear the screen to all white
tp_dialog()
  • Open artboard
tp_draw_board()

The function functions for the display are written in LCD.cpp, let's take a look at these functions:

  • Screen initialization, complete the configuration writing of the ST7789 chip here.
void TFT::lcd_init()//Screen initialization
  • Draw dots:
void TFT::lcd_draw_point(uint16_t hwXpos, uint16_t hwYpos, uint16_t hwColor)
  • Display a character:
void TFT::lcd_display_char(uint16_t hwXpos, uint16_t hwYpos, uint8_t chChr, uint8_t chSize, uint16_t hwColor)
  • Display a number:
void TFT::lcd_display_num(uint16_t hwXpos,uint16_t hwYpos,uint32_t chNum,uint8_t chLen,uint8_t chSize,uint16_t hwColor)
  • Draw straight lines:
void TFT::lcd_draw_line(uint16_t hwXpos0, uint16_t hwYpos0, uint16_t hwXpos1, uint16_t hwYpos1, uint16_t hwColor)
  • Draw a circle:
void TFT::lcd_draw_circle(uint16_t hwXpos, uint16_t hwYpos, uint16_t hwRadius, uint16_t hwColor)
  • Draw a horizontal straight line:
void TFT::lcd_draw_v_line(uint16_t hwXpos, uint16_t hwYpos, uint16_t hwHeight, uint16_t hwColor)
  • Draw vertical lines:
void TFT::lcd_draw_h_line(uint16_t hwXpos, uint16_t hwYpos, uint16_t hwWidth, uint16_t hwColor)
  • Draw a rectangle:
void TFT::lcd_draw_rect(uint16_t hwXpos, uint16_t hwYpos, uint16_t hwWidth, uint16_t hwHeight, uint16_t hwColor)

In the font.c file, two font sizes of height 12 width 6 and height 16 width 8 are defined

It should be noted that the format of the picture should be 240*320, 24bit, bmp, and the format of the SD card should be FAT.

STM32

This demo has been tested on XNUCLEO-F103RB, just insert XNUCLEO-F103RB directly as shown below. The model of XNUCLEO-F103RB is STM32F103RBT6. If you need to transplant the program, please connect it according to the actual pin and the schematic diagram

How to Insert

2.8inch TFT Touch Shield Insert.png

Resources

Datasheets

Software

FAQ

Support

Support

If you require technical support, please go to the Support page and open a ticket.