ili9325 tft lcd quotation
We’ve done quite a number of tutorials on the use of several displays with Arduino boards and today we will add another tutorial to that list. We will look at the ILI9325 based 2.8″ touchscreen display shown below and how it can be used with the Arduino to deliver a better user experience for your projects.
For today’s tutorial, we will use the ILI9325 driver based, 2.8″ display from Geekcreit. The display comes as a shield so it’s ready to be used for Arduino based projects. It is an 18-bit color display with a total of 262,000 different color shades. The display has a resolution of 240 x 320 pixels with individual pixel control.
The 2.8″ TFT display used for this project comes as a shield with the form factor of the Arduino Uno. This makes it easy to connect the shield to boards like the Uno, Mega and Due, as all we need to do, is plug it directly into the board, eliminating all the mess made by wires. Plug the display to the Arduino as shown in the image below.
The code for this tutorial is heavily reliant on a modified version of Adafruit’s TFT LCD,GFX and touchscreen libraries. These libraries can be downloaded from the links attached to them.
Next, we declare the colors to be used with their hexadecimal values and we create an object of the Adafruit TFTLCD library, indicating the variables used to represent the pins of the Arduino to which the display is connected.
We start by initializing the serial monitor and the display. After this, we set the orientation of the LCD and fill the screen with a black color to serve as the background.
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_GFX \glcdfont.c:9:23: warning: "font" defined but not used [-Wunused-variable]
In file included from C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:11:0:
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\pin_magic.h:271:3: error: #error "Board type unsupported / not recognized"
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp: In constructor "Adafruit_TFTLCD::Adafruit_TFTLCD(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)":
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:91:54: error: "digitalPinToPort" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:91:55: error: "portOutputRegister" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:95:38: error: "digitalPinToBitMask" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp: In member function "void Adafruit_TFTLCD::write8(uint8_t)":
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:765:21: error: "write8inline" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp: In member function "uint8_t Adafruit_TFTLCD::read8()":
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:772:27: error: "read8inline" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp: In member function "void Adafruit_TFTLCD::setWriteDir()":
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:779:21: error: "setWriteDirInline" was not declared in this scope
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp: In member function "void Adafruit_TFTLCD::setReadDir()":
C:\Users\Mystuff\Projects\Arduino Software\MyArduino Projects\MyArduinoLibraries\libraries\Adafruit_TFT LCD\Adafruit_TFTLCD.cpp:785:20: error: "setReadDirInline" was not declared in this scope
I have been running into problems when I wanted to actually display something on the screen using TFT LCD library (https://github.com/adafruit/TFTLCD-Library) (and the GFX library (https://github.com/adafruit/Adafruit-GFX-Library))...
Connect the seventh pin RST (Reset) to the Arduino Reset line. This will reset the panel when the Arduino is Reset. You can also use a digital pin for the LCD reset but this will save us a pin.
Adafruit is also selling a shield version of you display and I think you can use this to verify you pin assignment. With this: https://github.com/adafruit/TFTshield/blob/master/schem.png
I just got my teensy3 displaying the graphicstest on my LCD. Your description here of how to do it was just fine, though it took me a couple of tries to get the wiring right (my fault, though)
I got this going as well thanks to your guidance. While I was fiddling with the pinouts etc. in pinmagic, I did a couple of other things, in Adafruit_TFTLCD:
inline Adafruit_GFX& operator() (uint8_t x, uint8_t y,uint16_t c) {setCursor(x,y); setTextColor(c); return *this;} //use along w Streaming.h to support: tft(col,line,color)<<"a="<
inline Adafruit_GFX& operator() (uint8_t x, uint8_t y,uint16_t c,uint8_t s) {setCursor(x,y); setTextColor(c); setTextSize(s); return *this;} //use along w Streaming.h to support: tft(col,line,color,size)<<"a="<
http://www.ebay.de/itm/New-2-4-inch-TFT-LCD-Module-display-240-x-320-Screen-ILI9325-with-touch-pen-/281090515728?pt=UK_BOI_Electrical_Components_Suppl ies_ET&hash=item41724ce310
They are not using the current library, as you guessed. I tried patching pin_magic.h with the teensy 3 mods, but more is required for the current TFTLCD library. The library now supports DUE, and the constructor does a lot of work mapping the control pins into port register access for set/clear operations. Maybe the teensy equivalent would be to use
And I measured 32.7ma at 3.3v for the TFTLCD, so I powered it from the teensy 3 3.3v pin. This is on older Adafruit TFTLCD, http://www.adafruit.com/products/335
OK, maybe I"m confused, but does that library drive the Adafruit display in 8-bit mode (as described at https://learn.adafruit.com/adafruit-2-dot-8-color-tft-touchscreen-breakout-v2/8-bit-wiring)? The TFTLCD library has the disadvantage of needing more pins, but my impression was that it could achieve a higher throughput of data to the display, or am I mistaken in that as well?
Well, this is awkward. I had a 2.8" ILI9325 screen from Adafruit working on a Teensy 3.0 a couple of years back. I just tried to rebuild the code for that and I seem to have lost some files. Specifically I"m looking for the right Adafruit_TFTLCD library (well, I think that"s all I"m looking for). The current library from Github doesn"t compile with a Teensy3, and I recall I had to edit the pin_magic file as per ZTiK.nl (earlier in this thread). But the later files from Github look different now. I don"t seem to be able to go back to an earlier branch on Github.
I can see Paul has posted an ILI9341_t3 library, but mine is an ILI9325. Has anyone got a working copy of the library that works with my combination posted somewhere? I"d rather not upgrade the hardware at this stage, the problem I have is software.
This is a multicolored TFT LCD display with touchscreen and on-board SD card socket and 74HC245D. It is based on the ILI9325 controller and also compatible with ILI9341. This 2.4” TFT LCD Touch module is compatible with Arduino UNO and Arduino Mega boards and also works with Chipkit UNO32 and Simplecortex boards, since it can be operated at 3.3 V or 5 V.
I have done initializing of LCD by sending sequence of commands and command parameters. I have done the initializing in a function called void ili9341();
Joao Lopes’s library above uses a modified version of the Adafruit TFT library for the hardware layer. The Adafruit TFT library was originally for controlling ILIxxxx series of IC, but this guy modified it for the 8 bit interface of SPFD508.
Now, I’ve seen working code examples for STM32 for the ILIxxxx on Andy’s Workshop blog http://andybrown.me.uk/2012/01/01/stm32 … ft-driver/. So I’m tracking where Joao changed the Adafruit library to try and figure out how to modify an STM32 driver for this TFT.
Okay, I did a git diff on the SPFD5408 library and the Adafruit TFTLCD (for ILI9325 in 8 bit mode) library. Only one thing has been changed, and that is the readID function (it reads a register to identify the chip) which isn’t a big change at all. So I think an STM32 8 bit interface library for ILI9325 should work for the SPFD5408 as well. I’ll look for one or modify andy’s workshop code.
martinayotte wrote:I have an 3.5″ LCD from MCUFriend which looks almost the same as the one above, and I used some parallel 8bits code which use ILI9327 commands.
And also developed a touch screen lib which has some nice features (repeated touch, double touch), check the tftpaint.ino example of the touch library for details.
Theoretically they should give 2500mAh, I will be satisfied if I get 1500mAh out of them, this would mean 12h of 120mA (current consumption of TFT+blue pill).
If you post the defines that you have used in LCD_ID_readreg, I will know your wiring scheme and that it works! I can post a SPECIAL for you. And you can test it. The MapleMini is supported by both Roger’s MapleCore and the Core from ST.
I would get familiar with the basic TFT and GFX methods first. The existing TouchScreen libraries all have issues with Due, Zero, STM32, Teensy, … generally due to pinMode() and digitalWrite() “optimisations”.
I have a tft lcd shield. when I run it use arduino uno, it show me that identifier is ili9325 and works well but when I run it use STM32 blue pill, and this library:
it do not show until you READ ID of screen. Use LCD_ID_readreg.ino Paste your LCD_ID_readreg.ino example and make photo of your connection to blue pill.
The MCUFRIEND_kbv library is designed for 8-bit Shields. I know that LCD_RD is plugged into Analog #0 pin. Hence my list of #defines in the Readreg sketch.
If the ILI9325 has got a 16-bit databus, the readReg sketch will be reading the bits 15..8 of reg(0) all the time. You can re-write the readReg sketch if you want for 16-bit reads and writes.
The MCUFRIEND_kbv library is designed for 8-bit Shields. I know that LCD_RD is plugged into Analog #0 pin. Hence my list of #defines in the Readreg sketch.
If the ILI9325 has got a 16-bit databus, the readReg sketch will be reading the bits 15..8 of reg(0) all the time. You can re-write the readReg sketch if you want for 16-bit reads and writes.
It make sense to feed the display with 5V because the regulator on blue pill is not strong enough to deliver the necessary current for the background light of the LCD.