Go Down

Topic: [solved] Arduino DUE + 2.8 TFT (ITDB28) + UTFT (Read 767 times) previous topic - next topic

Cluoiset

Nov 25, 2013, 05:06 pm Last Edit: Nov 25, 2013, 09:59 pm by Cluoiset Reason: 1
Hi!

I'm trying to port a simple program to DUE from MEGA 2560. I'm trying to use the ITDB28 shield from ITEAD studio.
http://www.exp-tech.de/Displays/ITeadstudio-2-8-TFT-Touch-Shield-fuer-Arduino.html

The following code worked on MEGA 2560, but doesn't work on DUE.
I checked  the pins with scope, signals should be fine...I just don't know what am I doing wrong...

Code: [Select]

// UTFT_Textrotation_Demo (C)2013 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of the textrotation-functions.
//
// This demo was made for modules with a screen resolution
// of 320x240 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];

UTFT myGLCD(ITDB28,A5,A4,A3,A2);   // Remember to change the model parameter to suit your display module!

void setup()
{
 // Actually not needed
 pinMode(A5, OUTPUT);
 pinMode(A4, OUTPUT);
 pinMode(A3, OUTPUT);
 pinMode(A2, OUTPUT);
 
 myGLCD.InitLCD();
 myGLCD.clrScr();
 myGLCD.setFont(BigFont);
}

void loop()
{
   myGLCD.print("Text rotation", 0, 0);
   myGLCD.setColor(0, 0, 255);
   myGLCD.print("0 degrees", 0, 16, 0);
   myGLCD.print("90 degrees", 319, 0, 90);
   myGLCD.print("180 degrees", 319, 239, 180);
   myGLCD.print("270 degrees", 0, 239, 270);

   myGLCD.setFont(SevenSegNumFont);
   myGLCD.setColor(0, 255, 0);
   myGLCD.print("45", 90, 100, 45);
   myGLCD.print("90", 200, 50, 90);
   myGLCD.print("180", 300, 200, 180);

}

Cluoiset

#1
Nov 25, 2013, 09:55 pm Last Edit: Nov 25, 2013, 09:59 pm by Cluoiset Reason: 1
Problem solved.

The mistake was that MEGA2560 uses the same data lines as Uno and not as MEGA, and that is why it was working on Mega2560 although it was incorrect. Datalines had to be set up as MEGA.

This means using digital pins 22 - 29 for data.
And 38 - 41 for control.

Go Up