MEGA + ITeadstudio TFT incl. shield + UTFT

EDIT: Solved it, see second post.


Alright, I've got an Arduino MEGA board and this TFT+shield from ITeadstudio (the description is in english):

According to ITeadstudio this shield fully supports the MEGA and the UTFT library, but I can't get beyond a white screen.

I've gone through multiple UTFT examples distributed with the library itself. At the line

UTFT myGLCD(ITDB32S,38,39,40,41);   // Remember to change the model parameter to suit your display module!

I tried all the available models listed for ITeadstudio in the UTFT documentation since I couldn't find out the exact model name (and I didn't found anything on the manufacturer's site). Could there be a problem that I didn't hit the right model?

Furthermore the shield doesn't seem to be physically completly compatible, as seen in this pictures:
Imgur: The magic of the Internet (edit: forgot an image)

This is also the only possible position because of the distances between the pin banks. The shield gets energy but could this be the problem?

Many thanks in advance.

Alright, I found a solution to the problem and want to share it with you:

The name for the display driver is S6D1121_8 and the correct UTFT model name is ITDB24E_8. It works as-is on an Arduino Uno with UTFT 2.0:

The display doesn’t work on a MEGA. Henning Karlsen suggests modifying the library as described here:

In my case, it still didn’t work. I made a typo in the file HW_AVR.h (the one which should be edited in the instructions given above) that wasn’t noticed by the compiler (not included?) and so I also changed the same lines of code in the header file corresponding to the MEGA board (HW_ATmega1280.h). Both files are attached to this post though I don’t know if HW_AVR.h is still necessary since it doesn’t get included by one of the DEFINES.1

It STILL didn’t work.
Then I noticed that the control pins given in the UTFT constructor seem to be wrong (after reading this post: The pins needed to be set to the available analog pins. So the correct constructor looks for my configuration like this:

UTFT myGLCD(S6D1121_8,A5,A4,A3,A2);

Now it works! Really slow, but thats okay.

Some problems still occured:

  • The Serial-via-USB Port isn’t available because it is blocked by two of the display pins. This would have been also the case with the UNO. The other three serial ports are still usable.
  • The Voltage and Ground pins are blocked. I simply soldered two wires from the bottom side to a bread board.
  • The Numbers used to address interrupts will sabotage display function (e.g. to use external interrupt 3 on pin 20 I have to state it as pin 3). Maybe I made a mistake, but I solved this by not using any writes or mode changes on that pin, just the “read” from the interrupt (a tilt sensor that reset a timer when activated).
  • It is really really slow and often freezes after an upload.

Well I hope that helps someone!

See you,

1 My compiler (the one shipped with Arduino IDE 1.0.1 on Linux-64) also didn’t like that the font data in DefaultFonts.c weren’t declared as const and these two lines in UTFT.cpp:

#include "HW_ATMega328P.h"
#include "HW_ATMega32U4.h"

The files are named HW_ATmega328P.h and HW_ATmega32U4.h instead.

HW_ATmega1280.h (4.89 KB)

HW_AVR.h (5.77 KB)

Awesome post! Thank you!
It's not running quite as well as it does on my UNO, but this shield on the UNO is pointless since there is only something like 1 available digital pin after using this shield.

Do you have any suggestions for getting the UTouch library working with these shields on the Mega?

I got it to work.

I changed the pin constructor as follows:

UTFT myGLCD(ITDB28,A5,A4,A3,A2);
UTouch myTouch(55,60,54,8,9);