0

I have interfaced HC024071 TFT Display with Arduino Due using SPFD5408 Adafruit library. It works perfect.

But using the same library with Arduino Due (with pin connections modified as follows):

// For the Arduino Uno, Duemilanove, Diecimila, etc.:
//   D0 connects to digital pin 8  (Notice these are
//   D1 connects to digital pin 9   NOT in order!)
//   D2 connects to digital pin 2
//   D3 connects to digital pin 3
//   D4 connects to digital pin 4
//   D5 connects to digital pin 5
//   D6 connects to digital pin 6
//   D7 connects to digital pin 7

But unfortunately, errors occur (which made me guess Due is incompatible with the same)

Build options changed, rebuilding all
In file included from C:\Users\Arun Baby\Desktop\test\sketch_dec16c\sketch_dec16c.ino:2:0:

sketch\TFTLIB.H: In function 'void Draw_Welcome_Screen()':

sketch\TFTLIB.H:154:36: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Z.A.R.S",55,150,BLUE,3);

                                    ^

sketch\TFTLIB.H:155:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Zone Adaptive Response System",25,180,BLACK,1);

                                                           ^

sketch\TFTLIB.H:157:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Touch anywhere to continue!",30,280,BLACK,1);

                                                         ^

sketch\TFTLIB.H: In function 'void Draw_Menu()':

sketch\TFTLIB.H:166:48: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Z.A.R.S Main Menu",120,300,WHITE,1);

                                                ^

sketch\TFTLIB.H:168:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Driving Mode",20,45,0x1220,2);

                                          ^

sketch\TFTLIB.H:169:46: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Zones Supported",20,135,0x1220,2);

                                              ^

sketch\TFTLIB.H:170:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Settings",20,225,0x1220,2);

                                       ^

sketch\TFTLIB.H: In function 'void Draw_Settings()':

sketch\TFTLIB.H:179:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Settings",160,300,WHITE,1);

                                       ^

sketch\TFTLIB.H:181:43: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("Re-Caliberate",20,45,0x1220,2);

                                           ^

sketch\TFTLIB.H:182:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("GPS Lock",20,135,0x1220,2);

                                       ^

sketch\TFTLIB.H:183:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   draw_text("BACK",20,225,WHITE,2);

                                  ^

sketch\TFTLIB.H: In function 'void Manual_Recaliberation()':

sketch\TFTLIB.H:189:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Touchscreen \n   Recaliberation",60,100,WHITE,2);

                                                               ^

sketch\TFTLIB.H:191:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("STEP 1",100,200,WHITE,2);

                                       ^

sketch\TFTLIB.H:192:60: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Please touch the BLUE dot...",40,250,WHITE,1);

                                                            ^

sketch\TFTLIB.H:198:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Touchscreen \n   Recaliberation",60,100,WHITE,2);

                                                               ^

sketch\TFTLIB.H:200:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("STEP 2",100,200,WHITE,2);

                                       ^

sketch\TFTLIB.H:201:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Please touch the RED dot...",40,250,WHITE,1);

                                                           ^

sketch\TFTLIB.H:209:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Touchscreen \n   Recaliberation",60,100,WHITE,2);

                                                               ^

sketch\TFTLIB.H:211:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("STEP 3",100,200,WHITE,2);

                                       ^

sketch\TFTLIB.H:212:62: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Please touch the YELLOW dot...",40,250,WHITE,1);

                                                              ^

sketch\TFTLIB.H:224:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("Recaliberation \n    Complete",30,100,WHITE,2);

                                                             ^

sketch\TFTLIB.H:227:36: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     draw_text("BACK",20,225,WHITE,2);

                                    ^

In file included from C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_Adafruit_TFTLCD.cpp:30:0:

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\pin_magic.h:306:33: warning: backslash and newline separated by space [enabled by default]

   #define read8inline(result) { \    

 ^

In file included from C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/pins_arduino.h:20:0,

                 from C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:6:

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp: In member function 'TSPoint TouchScreen::getPoint()':

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )

                                                                 ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:61:21: note: in expansion of macro 'digitalPinToPort'

   uint8_t xp_port = digitalPinToPort(_xp);

                     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )

                                                                 ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:62:21: note: in expansion of macro 'digitalPinToPort'

   uint8_t yp_port = digitalPinToPort(_yp);

                     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )

                                                                 ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:63:21: note: in expansion of macro 'digitalPinToPort'

   uint8_t xm_port = digitalPinToPort(_xm);

                     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )

                                                                 ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:64:21: note: in expansion of macro 'digitalPinToPort'

   uint8_t ym_port = digitalPinToPort(_ym);

                     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:77:4: note: in expansion of macro 'portOutputRegister'

   *portOutputRegister(yp_port) &= ~yp_pin;

    ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:78:4: note: in expansion of macro 'portOutputRegister'

   *portOutputRegister(ym_port) &= ~ym_pin;

    ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:86:4: note: in expansion of macro 'portOutputRegister'

   *portOutputRegister(xp_port) |= xp_pin;

    ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:87:4: note: in expansion of macro 'portOutputRegister'

   *portOutputRegister(xm_port) &= ~xm_pin;

    ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:102:5: note: in expansion of macro 'portOutputRegister'

    *portOutputRegister(xp_port) &= ~xp_pin;

     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:106:5: note: in expansion of macro 'portOutputRegister'

    *portOutputRegister(yp_port) |= yp_pin;

     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:125:5: note: in expansion of macro 'portOutputRegister'

    *portOutputRegister(xp_port) &= ~xp_pin;

     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:129:5: note: in expansion of macro 'portOutputRegister'

    *portOutputRegister(ym_port) |= ym_pin;

     ^

C:\Users\Arun Baby\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

C:\Users\Arun Baby\Documents\Arduino\libraries\SPFD5408-master\SPFD5408_TouchScreen.cpp:133:5: note: in expansion of macro 'portOutputRegister'

    *portOutputRegister(yp_port) &= ~yp_pin;

     ^

Is it actually true? Is SPFD5408 completely incompatible with Due? Trying out UTFT Library with Due gave errors and with Uno, Blank white screen.

Is there any library that is compatible with Due then?

0

Yes, that is true. It looks like it tries to do some low-level port manipulation for speed, but it doesn't know how to do that on a Due since it's a completely different beast.

You could always read the datasheet and look at the initialisation code (the hardest part to work out yourself) and roll your own code to control the TFT - it's not actually that hard usually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.