Friday, November 20, 2015

2.4 Inch TFT LCD Control By Arduino Atmega8

First of all, I want to tell you that this blog is for a project on 16x2 LCD display. For that I thought, Instead uses a color display, then it would be awesome. When I search Arduino Uno for a color display, I found the range using the Arduino UNO. Due to the size of the library I do not recommend using it on ATmega328 and ATmega32U4 as they only have 32KB of flash memory.
All range of can be found with this link: https://www.robomart.com .



Arduino Atmega

Finally for making this project bought Arduino Mega 2560. I'm very excited to try it as soon as possible and would like to convey that supports 240x320 resolution with a 2.4 "TFT display both the SD card and touch screen.


Requirements:

1. Arduino MEGA 2560
2. 2.4" TFT Display
3. Wires
3. Small Breadboard 



2.4 TFT LCD

Connections:



A small error is found and here is one of the amendments. I also abbreviations TFT changed to match them with.

1. Display

LEDA -> 5V
VCC -> 5V
RD -> 3.3V 
GND -> GND
DB0->DB7 to pin D37->D30
DB8->DB15 to pin D22->D29
RS -> D38
WR -> D39
CS (pin15) -> D40
RSET-> D41

2. Touch Screen

Default pin number in example code:

T_CLK->D6
T_CS (pin30) ->D5
T_DIN ->D4
T_DO->D3
T_IRQ ->D2

3. SD Card:

SD_CLK -> D52
SD_DO -> D50
SD_DIN-> D51
SD_CS -> D53

Libraries and code:

We need UFTF library before running the example. Create the library and copy to Arduino/libraries. The examples can be found after restarting Arduino software.
Go to File > Examples > UTFT > Arduino (AVR) > UTFT_Demo_320x240
The only thing we have to do is just change the display model and the pins following the instruction. My TFT display model is ILI9325D_8 and the beginning of the code is as follow:

#include
// Declare which fonts we will be using extern uint8_t SmallFont[];
// Set the pins to the correct ones for your development shield
// ------------------------------------------------------------
// Arduino Uno / 2009:
// -------------------
// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2
// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2
/
/ Arduino Mega:
// -------------------
// Standard Arduino Mega/Due shield : ,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41
/
/ Remember to change the model parameter to suit your display module! UTFT myGLCD(ILI9325D_8,38,39,40,41);

Let's upload the code and see what happens...........

Result:

Next time I will try to do something a little bit complicated. Thanks for reading this it.

No comments:

Post a Comment