Help with ili9327 and arduino due

Hi all, I am new hire but I have big problem.
I buy
3.6 inch TFT Touch LCD Screen Display Module For Arduino UNO R3 HIGH QUALITY NEW, Resolution 400x240 which is working with ili9327
and I have Arduino due : DUE 2012 R3 Board AT91SAM3X8E ARM 32 Bit for Arduino with Data Cable Set

I can not use any library to get it work, I just need to import one picture from sd cart, write 4 words and use touchscreen.

Thanks in advance

Well, think about it. You have chosen a Shield that is designed for a Uno.
Then decided that you want to run it on the Due.

The microSD cannot work with the Due hardware SPI.
The resistive TouchScreen will not work with the current Touch libraries because it shares pins with the TFT.

The TFT should "work" with my library but currently there is a problem with LANDSCAPE and PORTRAIT_REV rotations with a 9327 controller.

Buy a Uno. Run the Shield on the Arduino that it was intended for
.
Yes, you can bit-bang the microSD on the Due. You can restore pins to GPIO mode after each Touch operation. The performance will not match the Uno.

If you really want to run on a Due, buy a CTE adapter shield for the Due and a regular 40-pin TFT module.

David.

Hello,

as this is the only thread that I found about arduino due and ili9327 lcd, I will write my experience here.

I have arduino DUE and 3.6 inch 400x240 display:
http://www.aliexpress.com/snapshot/6606355825.html

I am using David's library:
https://forum.arduino.cc/index.php?topic=366304.msg2524865#msg2524865

and required adafruit libraries:

kbv graphic examples work fine, but when I try to use touchscreen I get result only for X axis

this is the test program (modified tftpaint_shield_kbv):

// the regular Adafruit "TouchScreen.h" library only works on AVRs

// different mcufriend shields have Touchscreen on different pins
// and rotation.
// Run the UTouch_calibr_kbv sketch for calibration of your shield

#include <Adafruit_GFX.h>    // Core graphics library
//#include <Adafruit_TFTLCD.h> // Hardware-specific library
//Adafruit_TFTLCD tft(A3, A2, A1, A0, A4);
#include <MCUFRIEND_kbv.h>
//MCUFRIEND_kbv tft;       // hard-wired for UNO shields anyway.
#include <TouchScreen.h>

#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif


// These are the pins for some typical shields!
// S6D0154: YP=A1, XM=A2, YM=7, XP=6
// ST7783 : YP=A2, XM=A1, YM=6, XP=7
// ILI9320: YP=A2, XM=A3, YM=8, XP=9
// ILI9325: YP=A1, XM=A2, YM=7, XP=6
// ILI9325BG: YP=A2, XM=A1, YM=6, XP=7
// ILI9341: YP=A2, XM=A1, YM=7, XP=6
// ILI9488: YP=A1, XM=A2, YM=7, XP=6
// R65109V: YP=A2, XM=A1, YM=6, XP=7

// most mcufriend shields use these pins and Portrait mode:
uint8_t YP = A1;  // must be an analog pin, use "An" notation!
uint8_t XM = A2;  // must be an analog pin, use "An" notation!
uint8_t YM = 7;   // can be a digital pin
uint8_t XP = 6;   // can be a digital pin
uint8_t Landscape = 0;

uint16_t TS_LEFT = 920;
uint16_t TS_RT = 150;
uint16_t TS_TOP = 940;
uint16_t TS_BOT = 120;

// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0

// Assign human-readable names to some common 16-bit color values:
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

int16_t BOXSIZE;
int16_t PENRADIUS = 3;
uint16_t oldcolor, currentcolor;

void setup(void)
{
    Serial.begin(9600);
    Serial.println(F("Paint_kbv !"));


    ts = TouchScreen(XP, YP, XM, YM, 300);     //call the constructor AGAIN with new values.

    delay(1000);
}

#define MINPRESSURE 10
#define MAXPRESSURE 1000

void loop()
{
    int tmp;
    TSPoint p = ts.getPoint();

    if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {

        Serial.print("X = "); Serial.print(p.x);
        Serial.print("\tY = "); Serial.print(p.y);
        Serial.print("\tPressure = "); Serial.println(p.z);
      
        if (Landscape) {   // swap X and Y
            tmp = p.x;
            p.x = p.y;
            p.y = tmp;
        }

    }
}

and this is the result that I get in serial output:

X = 669 Y = 1 Pressure = 276
X = 541 Y = 2 Pressure = 499
X = 541 Y = 2 Pressure = 356
X = 543 Y = 1 Pressure = 356
X = 542 Y = 1 Pressure = 345
X = 543 Y = 1 Pressure = 340
X = 546 Y = 1 Pressure = 220
X = 135 Y = 2 Pressure = 396
X = 137 Y = 1 Pressure = 297
X = 137 Y = 1 Pressure = 313
X = 137 Y = 2 Pressure = 300
X = 137 Y = 1 Pressure = 292
X = 143 Y = 1 Pressure = 113
X = 142 Y = 1 Pressure = 128
X = 141 Y = 1 Pressure = 291
X = 837 Y = 2 Pressure = 807
X = 837 Y = 1 Pressure = 443
X = 837 Y = 2 Pressure = 476
X = 839 Y = 3 Pressure = 585
X = 838 Y = 3 Pressure = 564
X = 838 Y = 1 Pressure = 145
X = 848 Y = 1 Pressure = 191
X = 440 Y = 486 Pressure = 541
X = 549 Y = 2 Pressure = 721
X = 549 Y = 2 Pressure = 508
X = 549 Y = 2 Pressure = 496
X = 548 Y = 1 Pressure = 423
X = 548 Y = 1 Pressure = 423
X = 562 Y = 1 Pressure = 186
X = 562 Y = 1 Pressure = 209
X = 511 Y = 2 Pressure = 681
X = 510 Y = 2 Pressure = 383
X = 510 Y = 2 Pressure = 470
X = 510 Y = 1 Pressure = 348
X = 511 Y = 2 Pressure = 401
X = 517 Y = 1 Pressure = 132
X = 519 Y = 1 Pressure = 221

when I switch from

uint8_t YP = A1;
uint8_t XM = A2;
uint8_t YM = 7;
uint8_t XP = 6;

to

uint8_t YP = A2;
uint8_t XM = A1;
uint8_t YM = 6;
uint8_t XP = 7;

I get results only for vertical position, does anyone have idea what could be the problem? thanks