Monday, August 29, 2016

Arduino_Shield_TFT_LCD_MCUFriend2.2

On the arduino forum ( https://forum.arduino.cc/index.php?topic=366304.0 ) is a long discussion about MCDfriends TFT LCD displays
There are different 2.4 TFT LCD MCU friends displays http://domoticx.com/arduino-shield-2-4-tft-lcd-touch/
In this blog you find are pictures of the shield LCD shield i wanted to test.

Warning:

With some of the boards the USB B-type port on the Arduino Uno R3 is taller then the headers. As a result, many shields, including this one can contact the metal shielding of the USB port, causing damage. The simplest way to avoid this is to place a piece of electrical tape, or other tape, on top of the USB port to insulate it. ( Source : http://www.xcluma.com/how-to-use-2.4inch-tft-lcd-mcufriend )


My shield has no connections or parts where the USB port is located therefore i did not insulate it.
My shield has also an SD card reader that i tested earlier .
On codebender.com i found a working Arduino to read info from the TFT LCD shields

I cloned the program , it worked for my shield :
Serial Monitor (to read the info)

This is the result i found on the Serial Monitor when running it with my 2.4 LCD MCUFriend shield

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 02 Inversion Control
reg(0x00B6) 00 0A 82 27 04 Display Control
reg(0x00B7) 00 06 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 21 00 00 00 00 Panel Control
reg(0x00CC) 00 71 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 03 03 NVM Read
reg(0x00D3) 00 00 93 41 ILI9341, ILI9488
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00EF) 00 03 80 02 02 02 ILI9327
reg(0x00F2) 00 02 02 02 02 02 02 02 02 02 02 02 Adjust Control 2
reg(0x00F6) 00 01 00 00 Interface Control

Pin layput

Shield pins with corresponding Arduino pins

LCD_D2   - Arduino Digital 2
LCD_D3   - Arduino Digital 3
LCD_D4   - Arduino Digital 4
LCD_D5   - Arduino Digital 5
LCD_D6   - Arduino Digital 6
LCD_D7   - Arduino Digital 7

LCD_D0    - Arduino Digital 8
LCD_D1    - Arduino Digital 9
SD_SS       - Arduino Digital 10
SD_DI        - Arduino Digital 11
SD_DO      - Arduino Digital 12
SD_SCK    - Arduino Digital 13


LCD_RST   - Arduino Analog 5
LCD_CS     - Arduino Analog 4
LSD_RS      - Arduino Analog 3
LCD_WR    - Arduino Analog 2
LCD_RD     - Arduino Analog 1

GND   - Arduino GND

5V   - Arduino 5V
3V3   - Arduino 3V

LCD demo / statistics

Another Arduino codebender program that worked on my shield is the program below.
The first time you need to be patient before you see something on the display.
The Serial Monitor outputs some statistic.





This is a sample output on the Serial Monitor:

TFT LCD test
Using Adafruit 2.8" TFT Breakout Board Pinout
TFT size is 240x400
Found ILI9341 LCD driver
240X400Benchmark                Time (microseconds)
Screen fill              1652596
Text                     403176
Lines                    5247424
Horiz/Vert Lines         171516
Rectangles (outline)     103188
Rectangles (filled)      3070180
Circles (filled)         1658068
Circles (outline)        2195988
Triangles (outline)      1279256
Triangles (filled)       1575676
Rounded rects (outline)  594328
Rounded rects (filled)   3623000
Done!

Some links






No comments: