Example Program for TFT_320QVT_9341 Display

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
I've recently bought this tft board from ebay. From the name of the board I assume it uses an ILI9341

controller and I want to access the display via the GPIOS of an ESP32 MCU (this means the Arduino

UTFT library cannot be used). I tried to get some more information about the TFT board, but I could

not even find out the configuration of the IM0..3 pins.

 

I'd like to ask whether somebody has more information on this TFT board or could even provide me with

an example code for controlling it (e.g. how to perform a low level access to the registers).

 

Thank you very much for any hints and help...

 

Theo

Last Edited: Thu. Dec 28, 2017 - 06:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I do not have this display.
.
As far as I know, the QVT version uses 8080-16 parallel interface.
The QDT version uses 8080-8 bus. The IM# pins are not accessible on either board.
.
But you have the board. You can check for yourself.
.
Your ESP32 has only just got enough GPIO for an 8080-8 bus. There is no way to drive 8080-16.
MCUFRIEND_kbv supports ESP32 and 8080-8.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi Theo, welcome to AVRFreaks.  Does a Microchip|Atmel AVR part fit into this design at all?  Shouldn't you be asking this at an ESP32 forum?

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your quick response,

do you think that the IM pins are internally connected so they select the 8080 MCU 16-bit bus interface I or II?

ili9341 supported modes

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm currently only evaluating which µC platform to use for my project

and I've just learned that my current one (esp32) hasn't got enough

pins anyways, so it is likely that I'll switch to AVR architecture.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ne0 wrote:
it is likely that I'll switch to AVR architecture.

 

 

So, then, this no longer applies:

this means the Arduino UTFT library cannot be used)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Ic1 pads are for a 8-pin serial RAM IC.   I2 is a 3.3 voltage regulator.  Short the J1 pads if you are using 3.3v on the host CPU. The other IC is the touch screen controller. 

 

You will have to make a custom interface if this 40pin header does not mate with the Arduino Mega2560.  If you are not using a 16-bit CPU, you can use two serial-to-parallel ICs to make a 16-bit parallel interface.   Then you need to know the sequence of initialization words needed to get the ili9341 TFT controller to function.  Try the init commands from any ili9341 driver. 

 

These parallel TFT controllers are difficult to work with. Often you don't know what the actual  internal TFT controller is, even if the board is marked with a specific controller number.   Roughly about 30% of the parallel TFTs that I have bought from eBay listings I can't get to work because they simply don't respond to the MCUFRIEND ino programs provided by David Prentice.  Generally I stick to the ST7735-based units even though they are only 160x128 pixels because I can get them to work about 95% of the time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as I know the LCD controller on these display's can change every week. Be carefull with assumptions.

The Rinkydink TFT lib's have some functions in them to test for different LCD controllers.

Searching on github for esp32 / TFT libs probably gives you a lot of code to experiment with.

 

Try to take small steps.

There is a good chance that your display is made to fit on a arduino mega 2560 compatible board.

These cost < $10 on Ali/Ebay and I think are a good starting point to verify that your TFT display actually works.

If your TFT display is designed to work with another development board then try to start from there.

Once you have a working combination of TFT, uC & Library

 

AVR's have been great for lots of projects in the last 20 years or so, but for stuff like these TFT displays they are a bit underpowered.

They can manage displaying some text, menu's and mostly static stuff, but struggle with real time full screen animations, such as an oscilloscope screen, scrolling graphs, etc.

 

And be weary of the "arduino" stuff.

A long time ago I've played a bit with the Adafruits lib.

By changing a single pin ( Was it chip select, or write ?) from the arduino digital_write() to a normal macro (optimized into single instruction) I got a very significant update in the screen update rate. It almost doubled. 80% faster or so, which is significant as it is the bottleneck.

In "pinmagic.h" there are a bunch of horrible macro's (like really terrible) to make the arduino board pinouts compattible with the lcd header pinouts. Swapping bits all over ports and such. Ugly stuff.

The performance difference between an ATMEGA and STM32 was so significant that I simply decided to not use these displays with AVR's.

 

Note that these displays are often used in 8- bit mode. This gives quite enough colors for a decent user interface.

One of the tricks used in making display writes faster ist to set a color on the data lines and then toggle the write bit a number of times to write lines/blocks of the same color to the display.

Dive a bin in the library code on you you can use this to your advantage.

 

ESP32 has plenty of uuhmph for managing a TFT display controller. If those 30+ io pins are not enough maybe consider adding a "slave" uC for i/o expansion.

I've also once used a "databus" topology. Added a bunch of TTL buffers such as 74hc574 connected to a 8-bit port. Quite fast i/o, but lots of pcb traces to draw.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com