Pages: [1]   Go Down
Author Topic: [SOLVED] Arduino Leonardo not compatible with UTFT?  (Read 1629 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!
I just unboxed an Leonardo and an ITDB02 TFT shield.
But I keeps displaying a white blank screen when i try running the examples that come with the UTFT library.
It lights up and all as it should but nothing more. The line i use to initialize UTFT looks like this:
Code:
UTFT myGLCD(ILI9325D_8,19,18,17,16);
(ILI9325D_8 is the same device constant as ITDB28)
( I'm not sure bout the pin numbers either, tried to figure out how those designations map over to the shield but failed so far to find sane relations)

I've wasted like 10hours already trying to figure it out while that white screen keeps staring at me.
Has anyone of you used the UTFT library on an leonardo? I read somewhere that 1.0.x IDE breaks some libraries, but since earlier versions of the arduino IDE do not support the leonardo;
I haven't been able to try those.

Any ideas welcome!
 
« Last Edit: August 02, 2012, 08:44:16 am by telamon » Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone of you used the UTFT library on an leonardo? I read somewhere that 1.0.x IDE breaks some libraries, but since earlier versions of the arduino IDE do not support the leonardo;
I haven't been able to try those.

If the code compiles I doubt it's a problem with the libraries.  The library incompatabilities were caused by changing one of the fundemental header files from "Wiring.h" to "Arduino.h", without either one included the IDE can't recongize many lower-level commands used.  If it was there'd be error messages for for all the unrecognized commands.

My educated guess is that your problem is with the pin identification, but since I don't have either the sheild or a Leonardo that's about all the assistance I can give you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Fark-seeker;
I think you guessed correctly.
I got the ITDB02 touch library working after having identified the control pins correctly.

Did the same for the UTFT initializer:

Quote
UTFT myGLCD(ILI9325D_8,A5,A4,A3,A2);
I couldn't find the Reset pin on this page , so i set it temporarily to A2 for lack of better ideas.

This did't work ofcourse but I feel a bit more confident about that line than the previous.

Anyways, I came across this article http://www.henningkarlsen.com/electronics/h_utft_arduino_shield_on_mega.php
and seeing as they're hard referenced by avr names i figured i might aswell compare the differences between an uno and leo;
Here's a mapping comparison for the DB8->DB15 pin referenced by the shield:
Code:
Pin TFT   Leo   Uno
-------------------
D0  DB8   PD2   PD0
D1  DB9   PD3   PD1
D2  DB10  PD1   PD2
D3  DB11  PD0   PD3
D4  DB12  PD4   PD4
D5  DB13  PC6   PD5
D6  DB14  PD7   PD6
D7  DB15  PE6   PD7

And just as I feared; the mappings completley different..
So I guess i'll have to patch UTFT to add support to the Leo.

I see some blocks like these defined in the UTFT library:
Code:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  ...
#else
  ...
#endif

Guess i'll have to add an else-if clause, does anyone know the Identifier for ATmega32U4 ? (maybe it's plainly __AVR_ATmega32U4__ ? )

Sincerely thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did it, great thanks to henning who foresaw this issue and wrote a sweet guide.

Here's my version of UTFT Library with ATmega32U4 patch.
https://github.com/telamon/utft
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad you got it working! smiley

While I appreciate the thanks, all I really did was prevent you from going down a dead-end.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yay! the best part is that i once again can become an blissfully unaware Arduino user without any knowledge of registers and so on.  smiley-wink
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2926
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not for long I fear. The Curiosity that brought you to Arduino, then to Leonardo... Will Eventually bring you to the registers as well. There is an old expression that Might fit here...

A Journey of a Thousand Miles... Is Begun with a single step.

Been There, Done That.
 
I can tell you however that learning is its own reward, Expressing the leanings to others, One of the Greater Joys Life provides

From an Auld Phart...

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Pages: [1]   Go Up
Jump to: